Mercurial > hg > Database > Alice
view src/main/java/alice/datasegment/ReceiveLocalData.java @ 369:0c24894db37e multicast
MulticastDataSegment's extends change from LocalDataSegment to RemoteDataSegment
author | sugi |
---|---|
date | Tue, 20 May 2014 15:00:21 +0900 |
parents | 8f71c3e6f11d |
children | aefbe41fcf12 |
line wrap: on
line source
package alice.datasegment; import java.io.IOException; import org.msgpack.type.ArrayValue; import org.msgpack.type.Value; import alice.codesegment.SingletonMessage; import alice.datasegment.ReceiverData; public class ReceiveLocalData implements ReceiverData { private Object obj; public ReceiveLocalData(Object obj2) { this.obj = obj2; } public String asString() { return (String) obj; } public int asInteger() { return (Integer) obj; } public Float asFloat() { return (Float) obj; } public ArrayValue asArray(){ return (ArrayValue) obj; } @SuppressWarnings("unchecked") public <T> T asClass(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; } }