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

Method compareTo

base/src/main/java/net/time4j/MachineTime.java:1064–1079  ·  view source on GitHub ↗
(MachineTime<U> other)

Source from the content-addressed store, hash-verified

1062 * @since 3.20/4.16
1063 */
1064 @Override
1065 public int compareTo(MachineTime<U> other) {
1066
1067 if (this.scale == other.scale) {
1068 if (this.seconds < other.seconds) {
1069 return -1;
1070 } else if (this.seconds > other.seconds) {
1071 return 1;
1072 } else {
1073 return (this.nanos - other.nanos);
1074 }
1075 } else {
1076 throw new ClassCastException("Different time scales.");
1077 }
1078
1079 }
1080
1081 @Override
1082 public boolean equals(Object obj) {

Callers 4

ofMethod · 0.45
plusMethod · 0.45
isShorterThanMethod · 0.45
isLongerThanMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected