Class TimeUtil
java.lang.Object
ca.spottedleaf.concurrentutil.util.TimeUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longclampTime(long value, long min, long max) static intcompareTimes(long t1, long t2) This function is appropriate to be used as aComparatorbetween two timestamps, which indicates whether the timestamps represented by t1, t2 that t1 is before, equal to, or after t2.static longgetGreatestTime(long t1, long t2) static longgetLeastTime(long t1, long t2) static booleanisAfter(long t1, long t2) Tests whethert1is aftert2.static booleanisAfterOrSame(long t1, long t2) Tests whethert1is the same as or aftert2.static booleanisBefore(long t1, long t2) Tests whethert1is beforet2.static booleanisBeforeOrSame(long t1, long t2) Tests whethert1is the same as or beforet2.
-
Field Details
-
DEADLINE_NOT_SET
public static final long DEADLINE_NOT_SET- See Also:
-
-
Method Details
-
compareTimes
public static int compareTimes(long t1, long t2) This function is appropriate to be used as aComparatorbetween two timestamps, which indicates whether the timestamps represented by t1, t2 that t1 is before, equal to, or after t2. -
isBefore
public static boolean isBefore(long t1, long t2) Tests whethert1is beforet2. -
isBeforeOrSame
public static boolean isBeforeOrSame(long t1, long t2) Tests whethert1is the same as or beforet2. -
isAfter
public static boolean isAfter(long t1, long t2) Tests whethert1is aftert2. -
isAfterOrSame
public static boolean isAfterOrSame(long t1, long t2) Tests whethert1is the same as or aftert2. -
getGreatestTime
public static long getGreatestTime(long t1, long t2) -
getLeastTime
public static long getLeastTime(long t1, long t2) -
clampTime
public static long clampTime(long value, long min, long max)
-