comparison src/alice/test/codesegment/local/wordcount/WordConfig.java @ 242:3bcaf12cf877

use MappedByteBuffer
author sugi
date Tue, 16 Apr 2013 18:26:07 +0900
parents 02783f3699b1
children
comparison
equal deleted inserted replaced
241:02783f3699b1 242:3bcaf12cf877
1 package alice.test.codesegment.local.wordcount; 1 package alice.test.codesegment.local.wordcount;
2 2
3 public class WordConfig { 3 public class WordConfig {
4 public String filename; 4 public String filename;
5 public int block = 1;
6 public static String[] array; 5 public static String[] array;
7 public int division = 16; 6 public int division = 16;
8 7
9 public WordConfig(String[] args) { 8 public WordConfig(String[] args) {
10 for (int i=0;i<args.length; i++){ 9 for (int i=0;i<args.length; i++){
11 if ("-f".equals(args[i])){ 10 if ("-f".equals(args[i])){
12 filename = args[++i]; 11 filename = args[++i];
13 } else if ("-b".equals(args[i])){ 12 } else if ("-d".equals(args[i])){
14 block = Integer.parseInt(args[++i]); 13 division = Integer.parseInt(args[++i]);
15 } 14 }
16 } 15 }
17 16
18 if (filename==null){ 17 if (filename==null){
19 System.out.println("Usage: WordCount -f FILENAME"); 18 System.out.println("Usage: WordCount -f FILENAME");
20 System.exit(0); 19 System.exit(0);
21 } 20 }
22 createKey();
23 } 21 }
24 22
25 public void createKey(){
26 array = new String[block];
27 for(int i = 0 ; i < block ; i++) {
28 array[i] = "array" + i;
29 }
30 }
31 } 23 }