Mercurial > hg > Members > tatsuki > Alice
view src/alice/codesegment/ReceiveLocalData.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.codesegment; import java.io.IOException; import org.msgpack.type.ArrayValue; import org.msgpack.type.Value; import alice.datasegment.Receiver; import alice.datasegment.ReceiverData; public class ReceiveLocalData implements ReceiverData { private Object obj; public ReceiveLocalData(Object obj2) { this.obj = obj2; } public String asString(Receiver receiver) { return (String) obj; } public int asInteger(Receiver receiver) { return (Integer) obj; } public Float asFloat(Receiver receiver) { return (Float) obj; } public ArrayValue asArray(Receiver receiver){ return (ArrayValue) obj; } @SuppressWarnings("unchecked") public <T> T asClass(Receiver receiver, Class<T> clazz) { return (T) obj; } @Override public Value getVal() { try { return SingletonMessage.getInstance().unconvert(obj); } catch (IOException e) { e.printStackTrace(); } return null; } @Override public Object getObj() { return obj; } }