Mercurial > hg > Members > tatsuki > Alice
comparison src/alice/test/codesegment/local/SingletonTestCodeSegment.java @ 314:f1f0638861ab
ping responce receivable
author | sugi |
---|---|
date | Fri, 06 Dec 2013 11:42:51 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
313:4b99234c88d4 | 314:f1f0638861ab |
---|---|
1 package alice.test.codesegment.local; | |
2 | |
3 import org.msgpack.type.Value; | |
4 | |
5 import alice.codesegment.CodeSegment; | |
6 import alice.datasegment.CommandType; | |
7 import alice.datasegment.Receiver; | |
8 | |
9 public class SingletonTestCodeSegment extends CodeSegment { | |
10 Receiver arg1 = ids.create(CommandType.PEEK); | |
11 private static SingletonTestCodeSegment instance = new SingletonTestCodeSegment(); | |
12 private SingletonTestCodeSegment(){} | |
13 | |
14 public static SingletonTestCodeSegment getInstance(){ | |
15 return instance; | |
16 } | |
17 | |
18 @Override | |
19 public void run() { | |
20 System.out.println("type = " + arg1.type); | |
21 System.out.println("index = " + arg1.index); | |
22 System.out.println("data = " + arg1.getVal()); | |
23 System.out.println(((Value)arg1.getVal()).getType()); | |
24 | |
25 if (arg1.index == 10) { | |
26 System.exit(0); | |
27 return; | |
28 } | |
29 | |
30 this.recycle(); | |
31 ods.update("local", "key2", "String data"); | |
32 } | |
33 | |
34 } |