public static class TimeUtil.TimePoint extends Object implements Comparable<TimeUtil.TimePoint>
Constructor and Description |
---|
TimePoint(long time,
TimeUnit unit,
TimeUtil.TimePoint next) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TimeUtil.TimePoint o) |
static TimeUtil.TimePoint |
findClosestAndWipe(TreeSet<? extends TimeUtil.TimePoint> points,
TimeUtil.TimePoint now)
This is a helper method to find the closest
TimeUtil.TimePoint in a
collection that is still of a greater value than the passed
TimeUtil.TimePoint . |
String |
format() |
String |
format(TimeUnit min) |
long |
getAmount(TimeUnit unit) |
TimeUtil.TimePoint |
getNext() |
TimeUtil.TimePoint |
getNextNonZero() |
TimeUtil.TimePoint |
getPoint(TimeUnit unit) |
long |
getTime() |
TimeUnit |
getUnit() |
String |
properName() |
TimeUtil.TimePoint |
setNext(TimeUtil.TimePoint next) |
public TimePoint(long time, TimeUnit unit, TimeUtil.TimePoint next)
public long getAmount(TimeUnit unit)
public TimeUtil.TimePoint getPoint(TimeUnit unit)
public long getTime()
public TimeUnit getUnit()
public TimeUtil.TimePoint getNext()
public TimeUtil.TimePoint getNextNonZero()
public TimeUtil.TimePoint setNext(TimeUtil.TimePoint next)
public String properName()
public String format()
public int compareTo(TimeUtil.TimePoint o)
compareTo
in interface Comparable<TimeUtil.TimePoint>
public static TimeUtil.TimePoint findClosestAndWipe(TreeSet<? extends TimeUtil.TimePoint> points, TimeUtil.TimePoint now)
TimeUtil.TimePoint
in a
collection that is still of a greater value than the passed
TimeUtil.TimePoint
. This method also truncates the passed collection
and will modify its contents! However, if no values are found this
method will return null.
TODO: Optimize to use binary searchpoints
- The TimeUtil.TimePoint
objects to look through. Should
be a sorted collectionnow
- The point of reference (ha!)Copyright © 2015. All rights reserved.