Interface Duration

All Known Implementing Classes:
DurationImpl

public interface Duration
Represents a quantity of any given TimeUnit
Author:
Lincoln Baxter, III
  • Method Details

    • getQuantity

      long getQuantity()
      Return the calculated quantity of TimeUnit instances.
    • getQuantityRounded

      long getQuantityRounded(int tolerance)
      Return the calculated quantity of TimeUnit instances, rounded up if getDelta() is greater than or equal to the given tolerance.
    • getUnit

      TimeUnit getUnit()
      Return the TimeUnit represented by this Duration
    • getDelta

      long getDelta()
      Return the number of milliseconds left over when calculating the number of TimeUnit's that fit into the given time range.
    • isInPast

      boolean isInPast()
      Return true if this Duration represents a number of TimeUnit instances in the past.
    • isInFuture

      boolean isInFuture()
      Return true if this Duration represents a number of TimeUnit instances in the future.