@Test public void testGetEncodingWithSmallPositiveValue() { DecoderImpl decoder = new DecoderImpl(); EncoderImpl encoder = new EncoderImpl(decoder); UnsignedIntegerType ult = new UnsignedIntegerType(encoder, decoder); UnsignedIntegerEncoding encoding = ult.getEncoding(UnsignedInteger.valueOf(1L)); assertEquals("incorrect encoding returned", EncodingCodes.SMALLUINT, encoding.getEncodingCode()); }
public UnsignedIntegerEncoding getEncoding(final UnsignedInteger val) { int i = val.intValue(); return i == 0 ? _zeroUnsignedIntegerEncoding : (i >= 0 && i <= 255) ? _smallUnsignedIntegerEncoding : _unsignedIntegerEncoding; }
UnsignedIntegerType extends AbstractPrimitiveType<UnsignedInteger> { public UnsignedIntegerEncoding getEncoding(final UnsignedInteger val) { int i = val.intValue(); return i == 0 ? _zeroUnsignedIntegerEncoding : (i >= 0 && i <= 255) ? _smallUnsignedIntegerEncoding : _unsignedIntegerEncoding; } }
UnsignedIntegerType extends AbstractPrimitiveType<UnsignedInteger> { public UnsignedIntegerEncoding getEncoding(final UnsignedInteger val) { int i = val.intValue(); return i == 0 ? _zeroUnsignedIntegerEncoding : (i >= 0 && i <= 255) ? _smallUnsignedIntegerEncoding : _unsignedIntegerEncoding; } UnsignedIntegerType(final EncoderImpl encoder, final DecoderImpl decoder); }
UnsignedIntegerType extends AbstractPrimitiveType<UnsignedInteger> { public UnsignedIntegerEncoding getEncoding(final UnsignedInteger val) { int i = val.intValue(); return i == 0 ? _zeroUnsignedIntegerEncoding : (i >= 0 && i <= 255) ? _smallUnsignedIntegerEncoding : _unsignedIntegerEncoding; } UnsignedIntegerType(final EncoderImpl encoder, final DecoderImpl decoder); Class<UnsignedInteger> getTypeClass(); UnsignedIntegerEncoding getEncoding(final UnsignedInteger val); void fastWrite(EncoderImpl encoder, UnsignedInteger value); UnsignedIntegerEncoding getCanonicalEncoding(); Collection<UnsignedIntegerEncoding> getAllEncodings(); }
UnsignedIntegerType extends AbstractPrimitiveType<UnsignedInteger> { public UnsignedIntegerEncoding getEncoding(final UnsignedInteger val) { int i = val.intValue(); return i == 0 ? _zeroUnsignedIntegerEncoding : (i >= 0 && i <= 255) ? _smallUnsignedIntegerEncoding : _unsignedIntegerEncoding; } UnsignedIntegerType(final EncoderImpl encoder, final DecoderImpl decoder); Class<UnsignedInteger> getTypeClass(); UnsignedIntegerEncoding getEncoding(final UnsignedInteger val); void fastWrite(EncoderImpl encoder, UnsignedInteger value); UnsignedIntegerEncoding getCanonicalEncoding(); Collection<UnsignedIntegerEncoding> getAllEncodings();  }