Exemplo n.º 1
0
 public AbstractBounds deserialize(DataInput in) throws IOException {
   if (in.readInt() == Type.RANGE.ordinal())
     return new Range(Token.serializer().deserialize(in), Token.serializer().deserialize(in));
   return new Bounds(Token.serializer().deserialize(in), Token.serializer().deserialize(in));
 }
Exemplo n.º 2
0
 public void serialize(AbstractBounds range, DataOutput out) throws IOException {
   out.writeInt(range instanceof Range ? Type.RANGE.ordinal() : Type.BOUNDS.ordinal());
   Token.serializer().serialize(range.left, out);
   Token.serializer().serialize(range.right, out);
 }