comparison src/alice/test/codesegment/local/TestCodeSegment.java @ 182:52a1fa5ba38b working

add filp api
author e095732
date Tue, 26 Feb 2013 13:46:18 +0900
parents d7816b9b72e9
children 75150396681c
comparison
equal deleted inserted replaced
181:52dcead81b90 182:52a1fa5ba38b
7 public class TestCodeSegment extends CodeSegment { 7 public class TestCodeSegment extends CodeSegment {
8 8
9 static int count = 0; 9 static int count = 0;
10 10
11 // create input datasegment arg1 11 // create input datasegment arg1
12 Receiver arg1 = ids.create(CommandType.TAKE); 12 Receiver arg1 = ids.create(CommandType.PEEK);
13 public TestCodeSegment(){ 13 public TestCodeSegment(){
14 arg1.setKey("key1"); 14 arg1.setKey("key1");
15 } 15 }
16 public TestCodeSegment(int index){ 16 public TestCodeSegment(int index){
17 arg1.setKey("key1",index); 17 arg1.setKey("key1",index);
18 } 18 }
19 19
20 @Override 20 @Override
21 public void run() { 21 public void run() {
22 //System.out.println("index = " + arg1.index); 22 //System.out.println("index = " + arg1.index);
23 System.out.println("data = " + arg1.val); 23 //System.out.println("data = " + arg1.val);
24 //System.out.println(arg1.val.getType()); 24 //System.out.println(arg1.val.getType());
25 25 if(count > 10000){
26 System.out.println(System.currentTimeMillis() - StartCodeSegment.t);
27 System.exit(1);
28 }
26 29
27 /* 30 /*
28 TestCodeSegment cs = new TestCodeSegment(); 31 TestCodeSegment cs = new TestCodeSegment();
29 cs.arg1.setKey("key1", arg1.index); 32 cs.arg1.setKey("key1", arg1.index);
30 */ 33 */
31 34 ods.update("local","key1",arg1.asInteger()+1);
35 //ods.flip(arg1, arg1.asInteger()+1);
32 new TestCodeSegment(); 36 new TestCodeSegment();
33 //new TestCodeSegment(arg1.index); 37 //new TestCodeSegment(arg1.index);
34 38
35 39 count++;
36 // DataSegment.get("local").update 40 // DataSegment.get("local").update
37 //ods.update("local", "key1", arg1.index); 41 //ods.update("local", "key1", arg1.index);
38 42
39 } 43 }
40 44