Mercurial > hg > Database > Alice
view src/alice/datasegment/Receiver.java @ 225:bc061ee5f31f
bitonic sort work but data is not sorted
author | sugi |
---|---|
date | Thu, 28 Mar 2013 18:10:24 +0900 |
parents | b5c642ba998e |
children | 02783f3699b1 |
line wrap: on
line source
package alice.datasegment; import alice.codesegment.InputDataSegment; /** * MessagePack implementation and DataSegment Receiver * @author kazz * */ public class Receiver { private ReceiverData data = new ReceiveRemoteData(); public InputDataSegment ids; public int index; public String from; public CommandType type; public String managerKey; public String key; public Receiver(InputDataSegment ids, CommandType type) { this.ids = ids; this.type = type; ids.regist(); } public void setKey(String managerKey, String key) { this.managerKey = managerKey; setKey(managerKey, key, 0); } public void setKey(String managerKey, String key, int index) { this.key = key; switch (type) { case PEEK: ids.peek(this, managerKey, key, index); break; case TAKE: ids.take(this, managerKey, key, index); break; default: break; } ids.setKey(); } public void setKey(String key) { setKey(key, 0); } public void setKey(String key, int index) { this.key = key; switch (type) { case PEEK: ids.peek(this, key, index); break; case TAKE: ids.take(this, key, index); break; default: break; } ids.setKey(); } public void setData(ReceiverData r) { data = r; } public int asInteger() { return data.asInteger(); } public String asString() { return data.asString(); } public <T> T asClass(Class<T> clazz) { return data.asClass(clazz); } public Object getObj() { return data.getObj(); } public Object getVal() { return data.getVal(); } }