Mercurial > hg > Database > Alice
view src/alice/test/codesegment/api/StartCodeSegment.java @ 290:4074077d118d
Refactor iterating process with for-each sentence.
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Oct 2013 03:26:38 +0900 |
parents | e4a5da56b394 |
children |
line wrap: on
line source
package alice.test.codesegment.api; import java.util.Random; import alice.codesegment.CodeSegment; import alice.test.codesegment.local.bitonicsort.DataList; public class StartCodeSegment extends CodeSegment { String[] args; public static int count = 1; public static int cnt = 1; public static long t = 0; public StartCodeSegment(String[] args){ this.args = args; } @Override public void run() { for (String arg : args) { if ("-update".equals(arg)) { UpdateCodeSegment cs1 = new UpdateCodeSegment(); cs1.ds1.setKey("key"); int[] array = new int[65536]; array[0] = 0; ods.update("local", "key", array); } else if ("-put".equals(arg)) { new PutCodeSegment().execute(); } else if ("-take".equals(arg)) { new PutCodeSegment().execute(); new TakeCodeSegment("num"); } else if ("-flip".equals(arg)) { new FlipCodeSegment("key").execute(); } else if ("-peek".equals(arg)) { System.out.println("start peek Test"); String key = "peek"; int size = 100000; DataList list = new DataList(size); Random rnd = new Random(); for (int cnt = 0; cnt < size; cnt++) { list.table[cnt] = rnd.nextInt(100000) + 10; } ods.put(key, list); new PeekCodeSegment(key); } } } }