Mercurial > hg > Database > jungle-network
view src/jungle/test/codesegment/practice/TestCodeSegment.java @ 2:20498c88a70d
add Container
author | one |
---|---|
date | Sun, 09 Jun 2013 13:53:16 +0900 |
parents | |
children | 49c0eaa4dce2 |
line wrap: on
line source
package jungle.test.codesegment.practice; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; import org.msgpack.type.Value; public class TestCodeSegment extends CodeSegment { // create input datasegment arg1 Receiver arg1 = ids.create(CommandType.PEEK); @Override public void run() { System.out.println("type = " + arg1.type); System.out.println("index = " + arg1.index); System.out.println("data = " + arg1.getVal()); System.out.println(((Value)arg1.getVal()).getType()); if (arg1.index == 10) { System.exit(0); return; } TestCodeSegment cs = new TestCodeSegment(); cs.arg1.setKey("key1", arg1.index); // DataSegment.get("local").update ods.update("local", "key1", "String data"); } }