SHARE
TWEET

asdasd

a guest Jul 17th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. interface PrinterReportParser {
  3.     List<User, UserInfo> parse(string data);
  4. }
  5.  
  6. class CanonE1220_Parser implements PrinterReportParser {
  7.     List<User, UserInfo> parse(string data){
  8.         return null;
  9.     }
  10. }
  11.  
  12. ...
  13.  
  14. Map<string, PrinterReportParser> parsers;
  15. for (Printer p in printers){
  16.     PrinterReportParser parser = parsers[p.version];
  17.     if (parser != null){
  18.         parser.parse(p.getReport());
  19.     } else {
  20.         System.out.println("This printer version is not supported");
  21.     }
  22. }
RAW Paste Data
Top