Class Interval
- java.lang.Object
-
- org.opencastproject.metadata.api.util.Interval
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceInterval.Match<A>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static IntervalboundedInterval(Date leftBound, Date rightBound)Constructor function for a bounded interval.abstract <A> Afold(Interval.Match<A> visitor)Safe decomposition.static IntervalfromValues(Date leftBound, Date rightBound)Create an interval from two dates.booleanisBounded()Test if both endpoints are not infinite.abstract booleanisLeftInfinite()Test if the right endpoint is infinite.abstract booleanisRightInfinite()Test if the left endpoint is infinite.static IntervalleftBoundedInterval(Date leftBound)Constructor function for a left bounded interval, i.e. an interval with an infinite right endpoint.static IntervalrightBoundedInterval(Date rightBound)Constructor function for a right bounded interval, i.e. an interval with an infinite left endpoint.
-
-
-
Method Detail
-
boundedInterval
public static Interval boundedInterval(Date leftBound, Date rightBound)
Constructor function for a bounded interval.
-
rightBoundedInterval
public static Interval rightBoundedInterval(Date rightBound)
Constructor function for a right bounded interval, i.e. an interval with an infinite left endpoint.
-
leftBoundedInterval
public static Interval leftBoundedInterval(Date leftBound)
Constructor function for a left bounded interval, i.e. an interval with an infinite right endpoint.
-
fromValues
public static Interval fromValues(Date leftBound, Date rightBound)
Create an interval from two dates. One of the dates may be null to indicate an infinite endpoint.- Throws:
IllegalArgumentException- if boths bounds are null
-
isBounded
public boolean isBounded()
Test if both endpoints are not infinite.
-
isLeftInfinite
public abstract boolean isLeftInfinite()
Test if the right endpoint is infinite.
-
isRightInfinite
public abstract boolean isRightInfinite()
Test if the left endpoint is infinite.
-
fold
public abstract <A> A fold(Interval.Match<A> visitor)
Safe decomposition.
-
-