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

Method compareTo

base/src/main/java/net/time4j/PlainTime.java:1621–1638  ·  view source on GitHub ↗
(PlainTime time)

Source from the content-addressed store, hash-verified

1619 * @see #isAfter(PlainTime)
1620 */
1621 @Override
1622 public int compareTo(PlainTime time) {
1623
1624 int delta = this.hour - time.hour;
1625
1626 if (delta == 0) {
1627 delta = this.minute - time.minute;
1628 if (delta == 0) {
1629 delta = this.second - time.second;
1630 if (delta == 0) {
1631 delta = this.nano - time.nano;
1632 }
1633 }
1634 }
1635
1636 return ((delta < 0) ? -1 : ((delta == 0) ? 0 : 1));
1637
1638 }
1639
1640 /**
1641 * <p>Dependent on the precision of this instance, this method yields a

Callers 4

isBeforeMethod · 0.95
isAfterMethod · 0.95
isSimultaneousMethod · 0.95
isValidMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected