345
|
1 package alice.test.topology.share;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7 public class LookUpData extends CodeSegment{
|
|
8
|
|
9 private Receiver data = ids.create(CommandType.PEEK);
|
|
10 String key;
|
|
11 int depth;
|
|
12
|
|
13 public LookUpData(String key,int index){
|
|
14 this.key = key;
|
|
15 this.data.setKey(key, index);
|
|
16 }
|
|
17
|
|
18 public LookUpData(String key,int index, int depth){
|
|
19 this.key = key;
|
|
20 this.depth = depth;
|
|
21 this.data.setKey(key, index);
|
|
22 }
|
|
23
|
|
24 @Override
|
|
25 public void run(){
|
|
26 new LookUpData(this.key,this.data.index);
|
|
27 DataInfo di = data.asClass(DataInfo.class);
|
|
28 System.out.println(System.nanoTime()-di.getTime());
|
|
29
|
|
30 }
|
|
31
|
|
32 } |