annotate src/main/java/alice/test/codesegment/api/FlipTest.java @ 345:8f71c3e6f11d

Change directory structure Maven standard
author sugi
date Wed, 16 Apr 2014 18:26:07 +0900
parents
children aefbe41fcf12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
345
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
1 package alice.test.codesegment.api;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
2
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
4 import alice.datasegment.CommandType;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
5 import alice.datasegment.Receiver;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
6
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
7 public class FlipTest extends CodeSegment{
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
8
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
9 private Receiver arg1 = ids.create(CommandType.PEEK);
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
10 public static long t = 0;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
11 public static boolean flag = false;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
12 public static int count = 10000;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
13 public FlipTest(String key){
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
14 arg1.setKey(key);
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
15 }
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
16
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
17 public FlipTest(String key, int index){
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
18 arg1.setKey(key, index);
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
19 }
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
20
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
21 @Override
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
22 public void run() {
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
23 if(flag){
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
24 System.out.println(System.currentTimeMillis() - t +" ms");
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
25 System.exit(0);
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
26 }
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
27 t = System.currentTimeMillis();
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
28 for (int i=0;i<count;i++)
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
29 ods.flip(arg1);
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
30 //ods.put(arg1.key ,arg1.getObj());
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
31 flag=true;
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
32
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
33 new FlipTest(arg1.key,count);
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
34
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
35 }
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
36
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
37
8f71c3e6f11d Change directory structure Maven standard
sugi
parents:
diff changeset
38 }