Mercurial > hg > Members > tatsuki > Alice
changeset 11:2ea5acb0ed16
add OutputDataSegment
author | one |
---|---|
date | Thu, 12 Jan 2012 20:22:23 +0900 |
parents | 5f7cce38b25c |
children | c4d6ff56b9bf |
files | src/alice/codesegment/CodeSegment.java src/alice/codesegment/OutputDataSegment.java src/alice/test/codesegment/StartCodeSegment.java src/alice/test/codesegment/TestCodeSegment.java |
diffstat | 4 files changed, 20 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/codesegment/CodeSegment.java Thu Jan 12 19:51:11 2012 +0900 +++ b/src/alice/codesegment/CodeSegment.java Thu Jan 12 20:22:23 2012 +0900 @@ -5,6 +5,7 @@ public abstract class CodeSegment { public InputDataSegment ids = new InputDataSegment(this); + public OutputDataSegment ods = new OutputDataSegment(); public abstract void run();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/alice/codesegment/OutputDataSegment.java Thu Jan 12 20:22:23 2012 +0900 @@ -0,0 +1,17 @@ +package alice.codesegment; + +import org.msgpack.type.Value; + +import alice.datasegment.DataSegment; + +public class OutputDataSegment { + + public void put(String managerKey, String key, Value val) { + DataSegment.get(managerKey).put(key, val); + } + + public void update(String managerKey, String key, Value val) { + DataSegment.get(managerKey).update(key, val); + } + +}
--- a/src/alice/test/codesegment/StartCodeSegment.java Thu Jan 12 19:51:11 2012 +0900 +++ b/src/alice/test/codesegment/StartCodeSegment.java Thu Jan 12 20:22:23 2012 +0900 @@ -4,7 +4,6 @@ import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; -import alice.datasegment.DataSegment; public class StartCodeSegment extends CodeSegment { @@ -18,7 +17,7 @@ System.out.println("create TestCodeSegment"); Value val = ValueFactory.createRawValue("String data"); - DataSegment.get("local").put("key1", val); + ods.put("local", "key1", val); } }
--- a/src/alice/test/codesegment/TestCodeSegment.java Thu Jan 12 19:51:11 2012 +0900 +++ b/src/alice/test/codesegment/TestCodeSegment.java Thu Jan 12 20:22:23 2012 +0900 @@ -4,7 +4,6 @@ import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; -import alice.datasegment.DataSegment; import alice.datasegment.DataSegmentValue; public class TestCodeSegment extends CodeSegment { @@ -22,7 +21,7 @@ cs.ids.execute(); Value val = ValueFactory.createRawValue("String data"); - DataSegment.get("local").put("key1", val); + ods.put("local", "key1", val); } }