Mercurial > hg > Database > Alice
view src/alice/datasegment/Receiver.java @ 215:1fd7067f0044 working
remove conversion flag
author | one |
---|---|
date | Wed, 27 Mar 2013 18:35:43 +0900 |
parents | fec0726bb126 |
children | 21bd8af1cf26 |
line wrap: on
line source
package alice.datasegment; import alice.codesegment.InputDataSegment; /** * MessagePack implementation and DataSegment Receiver * @author kazz * */ public class Receiver { public 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 Object getVal() { return data.getVal(); } public <T> T asClass(Receiver receiver, Class<T> clazz) { return data.asClass(receiver, clazz); } public int asInteger(Receiver receiver) { return data.asInteger(receiver); } public Object getObj() { return data.getObj(); } }