@Test public void testValueOfBigIntegerAboveMaxValueThrowsNFE() throws Exception { BigInteger aboveLimit = new BigInteger(TWO_TO_64_PLUS_ONE_BYTES); try { UnsignedLong.valueOf(aboveLimit); fail("Expected exception was not thrown"); } catch(NumberFormatException nfe) { } aboveLimit = aboveLimit.subtract(BigInteger.ONE); try { UnsignedLong.valueOf(aboveLimit); fail("Expected exception was not thrown"); } catch(NumberFormatException nfe) { } }
public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } }
UnsignedLong extends Number implements Comparable<UnsignedLong> { public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } } }
UnsignedLong extends Number implements Comparable<UnsignedLong> { public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } } UnsignedLong(long underlying); }
UnsignedLong extends Number implements Comparable<UnsignedLong> { public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } } UnsignedLong(long underlying); @Override int intValue(); @Override long longValue(); BigInteger bigIntegerValue(); @Override float floatValue(); @Override double doubleValue(); @Override boolean equals(Object o); int compareTo(UnsignedLong o); @Override int hashCode(); @Override String toString(); static UnsignedLong valueOf(long underlying); static UnsignedLong valueOf(final String value); static UnsignedLong valueOf(BigInteger bigInt); }
UnsignedLong extends Number implements Comparable<UnsignedLong> { public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } } UnsignedLong(long underlying); @Override int intValue(); @Override long longValue(); BigInteger bigIntegerValue(); @Override float floatValue(); @Override double doubleValue(); @Override boolean equals(Object o); int compareTo(UnsignedLong o); @Override int hashCode(); @Override String toString(); static UnsignedLong valueOf(long underlying); static UnsignedLong valueOf(final String value); static UnsignedLong valueOf(BigInteger bigInt); static final UnsignedLong ZERO; }