Project Coin finals

Ende Oktober sollte es dann kompilieren, ich muss noch ein wenig an dem Beispiel arbeiten😉

public class ProjectCoinFinals {

	private final static Set primes = { 2, 7, 31, 127, 8191, 131071, 524287 };
	private final static Map<String, Integer> wordCounter = new HashMap<>();
	private final static Integer oneMillionDollar = 1_000_000;
	private final static byte aByte = (byte)0b00100001;

	public static void main( String... args ) {
       		try (BufferedReader br = new BufferedReader(new FileReader(args[0])) {

           		handleLine( br.readLine() );
       		}
	}

	private static void handleLine( final String line ) {
       		switch (line) {
              		case "foo": foo(); break;
              		case "bar": bar(); break;
      		}
	}

	private static void foo() {
       		wordCounter["foo"] = wordCounter["foo"] == null ? 1 : wordCounter["foo"] + 1;
	}

	private static void bar() {
       		wordCounter["bar"] = wordCounter["bar"] == null ? 1 : wordCounter["bar"] + 1;	}

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s