MCPcopy Create free account
hub / github.com/MenoData/Time4J / compareTo

Method compareTo

base/src/main/java/net/time4j/tz/ZonalOffset.java:641–653  ·  view source on GitHub ↗
(ZonalOffset obj)

Source from the content-addressed store, hash-verified

639 * <p>Die nat&uuml;rliche Ordnung ist konsistent mit {@code equals()}. </p>
640 */
641 @Override
642 public int compareTo(ZonalOffset obj) {
643
644 if (this.total < obj.total) {
645 return -1;
646 } else if (this.total > obj.total) {
647 return 1;
648 } else {
649 int delta = (this.fraction - obj.fraction);
650 return ((delta < 0) ? -1 : ((delta == 0) ? 0 : 1));
651 }
652
653 }
654
655 /**
656 * <p>Compares the whole state. </p>

Callers 3

compareToMethod · 0.95
compareTZDBMethod · 0.45
atLongitudeMethod · 0.45

Calls

no outgoing calls

Tested by 1

compareToMethod · 0.76