@Test public void testLevelToNegative() throws Exception { Number n = new NumberWithGradient(3, -7, 2); int expected[] = { 3, 1, -1, -3, -5, -7, -7, -7}; for(int idx=0; idx<expected.length; idx++) { int i = n.intValue(); Assert.assertEquals("Invalid value at iteration " + idx, expected[idx], i); } }
@Override public int intValue() { return next().intValue(); }
NumberWithGradient extends Number { @Override public int intValue() { return next().intValue(); } }
NumberWithGradient extends Number { @Override public int intValue() { return next().intValue(); } NumberWithGradient(Number startValue, Number targetValue, Number gradient); }
NumberWithGradient extends Number { @Override public int intValue() { return next().intValue(); } NumberWithGradient(Number startValue, Number targetValue, Number gradient); @Override String toString(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); }
NumberWithGradient extends Number { @Override public int intValue() { return next().intValue(); } NumberWithGradient(Number startValue, Number targetValue, Number gradient); @Override String toString(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue();  }