@Test public void testLevelToJitter() throws Exception { Number val = new NumberWithJitter<Integer>(15, 1, 2); Number n = new NumberWithGradient(3, val, 2); int expected[] = { 3, 5, 7, 9, 11, 13 }; for(int idx=0; idx<expected.length; idx++) { int i = n.intValue(); Assert.assertEquals("Step 1: Invalid value at iteration " + idx, expected[idx], i); } for(int idx=0; idx<10; idx++) { int i = n.intValue(); Assert.assertTrue("Step 2: Invalid value at iteration " + idx, Math.abs(i - 15) <= 2); } }
@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();  }