// ParserTest.java import java.util.Map; /** * Simple program to test the parser and the SimpleMeter implementation. * * @author Fredrik Kilander for ID1006. */ public class ParserTest { public static void main (String [] args) { // Create the parser, giving it a TextMeter implementation. Parser parser = new Parser (new SimpleMeter ()); // For all strings on the commandline... for (String s : args) { parser.parse (s); // Parse each string } // Get the TextMeter from the parser... // ... retrieve the property map... // ... ask for the entry set... // ... for each key-value pair in the entry set... // ... print them out. for (Map.Entry M : parser.getMeter ().properties ().entrySet ()) { System.out.printf ("%10s : %8s%n", M.getKey (), M.getValue ()); } } } // ParserTest