Package org.ocpsoft.prettytime
Interface Duration
- All Known Implementing Classes:
DurationImpl
public interface Duration
Represents a quantity of any given
TimeUnit- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionlonggetDelta()Return the number of milliseconds left over when calculating the number ofTimeUnit's that fit into the given time range.longReturn the calculated quantity ofTimeUnitinstances.longgetQuantityRounded(int tolerance) Return the calculated quantity ofTimeUnitinstances, rounded up ifgetDelta()is greater than or equal to the given tolerance.getUnit()booleanbooleanisInPast()
-
Method Details
-
getQuantity
long getQuantity()Return the calculated quantity ofTimeUnitinstances. -
getQuantityRounded
long getQuantityRounded(int tolerance) Return the calculated quantity ofTimeUnitinstances, rounded up ifgetDelta()is greater than or equal to the given tolerance. -
getUnit
TimeUnit getUnit() -
getDelta
long getDelta()Return the number of milliseconds left over when calculating the number ofTimeUnit's that fit into the given time range. -
isInPast
boolean isInPast() -
isInFuture
boolean isInFuture()
-