@Override public int compareTo(Duration d) { org.joda.time.Duration d1 = getJodaTimeDuration(); org.joda.time.Duration d2 = d.getJodaTimeDuration(); if (d1 == null && d2 == null) { return 0; } else if (d1 == null) { return 1; } else if (d2 == null) { return -1; } int cmp = d1.compareTo(d2); if (cmp == 0) { if (d.isApprox() && !this.isApprox()) { // Put exact in front of approx return -1; } else if (!d.isApprox() && this.isApprox()) { return 1; } else { return 0; } } else { return cmp; } }
public int compareTo(Duration d) { org.joda.time.Duration d1 = getJodaTimeDuration(); org.joda.time.Duration d2 = d.getJodaTimeDuration(); if (d1 == null && d2 == null) { return 0; } else if (d1 == null) { return 1; } else if (d2 == null) { return -1; } int cmp = d1.compareTo(d2); if (cmp == 0) { if (d.isApprox() && !this.isApprox()) { // Put exact in front of approx return -1; } else if (!d.isApprox() && this.isApprox()) { return 1; } else { return 0; } } else { return cmp; } }
public int compareTo(Duration d) { org.joda.time.Duration d1 = getJodaTimeDuration(); org.joda.time.Duration d2 = d.getJodaTimeDuration(); if (d1 == null && d2 == null) { return 0; } else if (d1 == null) { return 1; } else if (d2 == null) { return -1; } int cmp = d1.compareTo(d2); if (cmp == 0) { if (d.isApprox() && !this.isApprox()) { // Put exact in front of approx return -1; } else if (!d.isApprox() && this.isApprox()) { return 1; } else { return 0; } } else { return cmp; } }
public org.joda.time.Duration getJodaTimeDuration() { if (minDuration == null) return maxDuration.getJodaTimeDuration(); if (maxDuration == null) return minDuration.getJodaTimeDuration(); Duration mid = minDuration.add(maxDuration).divideBy(2); return mid.getJodaTimeDuration(); }
@Override public org.joda.time.Duration getJodaTimeDuration() { if (minDuration == null) return maxDuration.getJodaTimeDuration(); if (maxDuration == null) return minDuration.getJodaTimeDuration(); Duration mid = minDuration.add(maxDuration).divideBy(2); return mid.getJodaTimeDuration(); }
public org.joda.time.Duration getJodaTimeDuration() { if (minDuration == null) return maxDuration.getJodaTimeDuration(); if (maxDuration == null) return minDuration.getJodaTimeDuration(); Duration mid = minDuration.add(maxDuration).divideBy(2); return mid.getJodaTimeDuration(); }
@Override public int compareTo(Duration d) { org.joda.time.Duration d1 = getJodaTimeDuration(); org.joda.time.Duration d2 = d.getJodaTimeDuration(); if (d1 == null && d2 == null) { return 0; } else if (d1 == null) { return 1; } else if (d2 == null) { return -1; } int cmp = d1.compareTo(d2); if (cmp == 0) { if (d.isApprox() && !this.isApprox()) { // Put exact in front of approx return -1; } else if (!d.isApprox() && this.isApprox()) { return 1; } else { return 0; } } else { return cmp; } }
@Override public org.joda.time.Duration getJodaTimeDuration() { if (minDuration == null) return maxDuration.getJodaTimeDuration(); if (maxDuration == null) return minDuration.getJodaTimeDuration(); Duration mid = minDuration.add(maxDuration).divideBy(2); return mid.getJodaTimeDuration(); }