@Test public void compareToTest() { DoubleValue dnull = new DoubleValue(null); DoubleValue dnull1 = new DoubleValue(null); DoubleValue d1 = new DoubleValue(1.0); DoubleValue d11 = new DoubleValue(1.0); DoubleValue d2 = new DoubleValue(2.0); Assert.assertEquals(0, dnull.compareTo(dnull1)); Assert.assertEquals(0, d1.compareTo(d11)); Assert.assertEquals(dnull, dnull1); Assert.assertEquals(d1, d11); Assert.assertTrue(dnull.compareTo(d1) > 0); Assert.assertTrue(d1.compareTo(dnull) < 0); Assert.assertTrue(d1.compareTo(d2) < 0); Assert.assertTrue(d2.compareTo(d1) > 0); }
@Override public int compareTo(Value<Double> arg) { if (arg == null) { return -1; } Double other = arg.getValue(); if (value == null) { if (other == null) { return 0; } return 1; } else if (other == null) { return -1; } return value.compareTo(other); }
DoubleValue implements Value<Double> { @Override public int compareTo(Value<Double> arg) { if (arg == null) { return -1; } Double other = arg.getValue(); if (value == null) { if (other == null) { return 0; } return 1; } else if (other == null) { return -1; } return value.compareTo(other); } }
DoubleValue implements Value<Double> { @Override public int compareTo(Value<Double> arg) { if (arg == null) { return -1; } Double other = arg.getValue(); if (value == null) { if (other == null) { return 0; } return 1; } else if (other == null) { return -1; } return value.compareTo(other); } DoubleValue(Double value); }
DoubleValue implements Value<Double> { @Override public int compareTo(Value<Double> arg) { if (arg == null) { return -1; } Double other = arg.getValue(); if (value == null) { if (other == null) { return 0; } return 1; } else if (other == null) { return -1; } return value.compareTo(other); } DoubleValue(Double value); @Override Double getDouble(); @Override Double getValue(); @Override void setValue(Double value); @Override int compareTo(Value<Double> arg); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DoubleValue implements Value<Double> { @Override public int compareTo(Value<Double> arg) { if (arg == null) { return -1; } Double other = arg.getValue(); if (value == null) { if (other == null) { return 0; } return 1; } else if (other == null) { return -1; } return value.compareTo(other); } DoubleValue(Double value); @Override Double getDouble(); @Override Double getValue(); @Override void setValue(Double value); @Override int compareTo(Value<Double> arg); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }