T
- specific type of the keypublic abstract class KeyInterval<T extends java.lang.Comparable<? super T>> extends java.lang.Object implements java.lang.Comparable<KeyInterval<T>>
Constructor and Description |
---|
KeyInterval() |
Modifier and Type | Method and Description |
---|---|
java.util.List<KeyInterval<T>> |
cutIntersectingIntervals(java.util.List<KeyInterval<T>> intervals,
KeyOperator<T> operator)
Given a list of intervals, cut from them the parts that intersects with "this" interval.
|
protected java.util.List<KeyInterval<T>> |
cutIntersectingIntervalsInner(java.util.List<KeyInterval<T>> intervals,
KeyOperator<T> operator)
Given a list of intervals, cut from them the parts that intersects with "this" interval.
|
boolean |
equals(java.lang.Object obj) |
abstract T |
getFrom()
Return the lower bound of the interval.
|
abstract T |
getTo()
Return the upper bound of the interval.
|
int |
hashCode() |
boolean |
intersect(KeyInterval<T> interval)
Return true if the interval intersects with this interval.
|
boolean |
isCovered(T key)
Return true if the interval covers given key.
|
java.lang.String |
toString()
Return the string representation of this interval.
|
public abstract T getFrom()
public abstract T getTo()
public final boolean isCovered(T key)
key
- the key to be testedpublic final boolean intersect(KeyInterval<T> interval)
interval
- the interval to be testedpublic java.util.List<KeyInterval<T>> cutIntersectingIntervals(java.util.List<KeyInterval<T>> intervals, KeyOperator<T> operator)
intervals
- list of intervalsoperator
- the operator fot this key typeprotected java.util.List<KeyInterval<T>> cutIntersectingIntervalsInner(java.util.List<KeyInterval<T>> intervals, KeyOperator<T> operator)
intervals
- list of intervalsoperator
- the operator fot this key typepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object