private PSmallint() { super("SMALLINT", Types.SMALLINT, Short.class, new ShortCodec(), 4); }
@Override public float decodeFloat(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
@Override public int encodeByte(byte v, byte[] b, int o) { return encodeShort(v,b,o); }
@Override public long decodeLong(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
@Override public int decodeInt(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
@Override public long decodeLong(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
private PSmallint() { super("SMALLINT", Types.SMALLINT, Short.class, new ShortCodec(), 4); }
@Override public int encodeInt(int v, byte[] b, int o) { if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be encoded as an Short without changing its value"); } return encodeShort((short)v,b,o); }
@Override public int encodeLong(long v, byte[] b, int o) { if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be encoded as an Short without changing its value"); } return encodeShort((short)v,b,o); }
@Override public double decodeDouble(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
@Override public int encodeFloat(float v, byte[] b, int o) { if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be encoded as an Short without changing its value"); } return encodeShort((short)v,b,o); }
@Override public int decodeInt(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
@Override public int encodeByte(byte v, byte[] b, int o) { return encodeShort(v,b,o); }
@Override public int encodeDouble(double v, byte[] b, int o) { if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be encoded as an Short without changing its value"); } return encodeShort((short)v,b,o); }
@Override public float decodeFloat(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
@Override public double decodeDouble(byte[] b, int o, SortOrder sortOrder) { return decodeShort(b, o, sortOrder); }
@Override public int encodeInt(int v, byte[] b, int o) { if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be encoded as an Short without changing its value"); } return encodeShort((short)v,b,o); }
@Override public int encodeFloat(float v, byte[] b, int o) { if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be encoded as an Short without changing its value"); } return encodeShort((short)v,b,o); }
@Override public byte decodeByte(byte[] b, int o, SortOrder sortOrder) { short v = decodeShort(b, o, sortOrder); if (v < Byte.MIN_VALUE || v > Byte.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be cast to Byte without changing its value"); } return (byte)v; }
@Override public int encodeDouble(double v, byte[] b, int o) { if (v < Short.MIN_VALUE || v > Short.MAX_VALUE) { throw newIllegalDataException("Value " + v + " cannot be encoded as an Short without changing its value"); } return encodeShort((short)v,b,o); }