Mercurial > hg > Members > tatsuki > Alice
diff src/alice/codesegment/InputDataSegment.java @ 205:28469b1671e7 working
repair flip API
author | sugi |
---|---|
date | Tue, 26 Mar 2013 01:45:05 +0900 |
parents | 7f47231ef509 |
children | 96110f25adcc |
line wrap: on
line diff
--- a/src/alice/codesegment/InputDataSegment.java Mon Mar 25 18:49:01 2013 +0900 +++ b/src/alice/codesegment/InputDataSegment.java Tue Mar 26 01:45:05 2013 +0900 @@ -2,8 +2,6 @@ import java.util.concurrent.atomic.AtomicInteger; -import org.msgpack.type.Value; - import alice.datasegment.Command; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; @@ -21,8 +19,6 @@ public CodeSegment cs; private AtomicInteger count = new AtomicInteger(1); // 1 for no input data segments private AtomicInteger keyCount = new AtomicInteger(0); // number of DataSegments - - private Command cmd; public InputDataSegment(CodeSegment cs) { this.cs = cs; @@ -60,16 +56,16 @@ DataSegment.getLocal().take(receiver, key, index, cs); } - public void flip(CommandType type, String key, Value val,Object obj) { - cmd.setElement(type, key, val, obj); + public void flip(Command cmd) { DataSegment.getLocal().flip(cmd); } - public void reply(Receiver receiver, DataSegmentValue val) { + public void reply(Receiver receiver, DataSegmentValue val, Command reply) { receiver.index = val.index; receiver.val = val.val; receiver.from = val.from; receiver.obj = val.obj; + receiver.setCommand(reply); receive(); } @@ -98,15 +94,4 @@ public Receiver create(CommandType type) { return new Receiver(this, type); } - - public void setCommand(Command cmd) { - this.cmd = cmd; - } - - public void reply(Receiver receiver, int index, Value val, Object obj, - String reverseKey) { - // TODO Auto-generated method stub - - } - }