|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--xxl.util.Interval1D
Class to implement one-dimensional intervals of any ordered data type. The order of the basic data type by means of comparators. The borders of an interval may or may not belong to the interval, as desired.
| Field Summary | |
protected java.lang.Object[] |
border
|
java.util.Comparator |
comparator
|
protected boolean[] |
inclusive
|
| Constructor Summary | |
Interval1D(Interval1D interval)
Copy-constructor. |
|
Interval1D(java.lang.Object point)
Constructs a new interval by providing a single point based on a Comparable data type. |
|
Interval1D(java.lang.Object leftBorder,
boolean leftInclusive,
java.lang.Object rightBorder,
boolean rightInclusive)
Constructs a new interval by providing the left and right borders based on a Comparable data type. |
|
Interval1D(java.lang.Object leftBorder,
boolean leftInclusive,
java.lang.Object rightBorder,
boolean rightInclusive,
java.util.Comparator comparator)
Constructs a new interval by providing the left and right borders and a comparator. |
|
Interval1D(java.lang.Object point,
java.util.Comparator comparator)
Constructs a new interval by providing a single point and a comparator. |
|
Interval1D(java.lang.Object leftBorder,
java.lang.Object rightBorder)
Constructs a new closed interval by providing the left and right borders based on a Comparable data type. |
|
Interval1D(java.lang.Object leftBorder,
java.lang.Object rightBorder,
java.util.Comparator comparator)
Constructs a new closed interval by providing the left and right borders and a comparator. |
|
Interval1D(Tree.Descriptor descriptor)
|
|
| Method Summary | |
java.lang.Object |
border(boolean rightBorder)
Returns the desired border of this interval. |
java.lang.Object |
clone()
Clones this interval. |
boolean |
contains(Interval1D interval)
Checks whether an interval is contained by this interval. |
int |
contains(java.lang.Object point)
Checks whether a point is contained by this interval. |
boolean |
contains(Tree.Descriptor descriptor)
|
boolean |
equals(java.lang.Object object)
Returns true iff the given object is an interval having the same border properties and comparators. |
boolean |
includes(boolean rightBorder)
Returns true if the desired border belongs to this interval. |
Interval1D |
intersect(Interval1D interval)
Shrinks this interval to reflect the intersection with a given interval. |
int |
overlaps(Interval1D interval)
Checks whether an interval and this interval do overlap. |
boolean |
overlaps(Tree.Descriptor descriptor)
|
java.lang.String |
toString()
Returns a String representation of this interval. |
Interval1D |
union(Interval1D interval)
Extends this interval to contain a given interval, too. |
Tree.Descriptor |
union(Tree.Descriptor descriptor)
|
| Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected java.lang.Object[] border
protected boolean[] inclusive
public final java.util.Comparator comparator
| Constructor Detail |
public Interval1D(java.lang.Object leftBorder,
boolean leftInclusive,
java.lang.Object rightBorder,
boolean rightInclusive,
java.util.Comparator comparator)
throws java.lang.IllegalArgumentException
leftBorder - The left border of the interval.leftinclusive - True iff the left border belongs to the interval.rightBorder - the right border of the interval.rightInclusive - True iff the right border belongs to the interval.comparator - The comparator defining the order on the basic data type.
public Interval1D(java.lang.Object leftBorder,
boolean leftInclusive,
java.lang.Object rightBorder,
boolean rightInclusive)
throws java.lang.IllegalArgumentException
leftBorder - The left border of the interval.leftinclusive - True iff the left border belongs to the interval.rightBorder - the right border of the interval.rightInclusive - True iff the right border belongs to the interval.
public Interval1D(java.lang.Object leftBorder,
java.lang.Object rightBorder,
java.util.Comparator comparator)
throws java.lang.IllegalArgumentException
leftBorder - The left border of the interval.rightBorder - the right border of the interval.comparator - The comparator defining the order on the basic data type.
public Interval1D(java.lang.Object leftBorder,
java.lang.Object rightBorder)
throws java.lang.IllegalArgumentException
leftBorder - The left border of the interval.rightBorder - the right border of the interval.
public Interval1D(java.lang.Object point,
java.util.Comparator comparator)
point - The only point the interval will contain.comparator - The comparator defining the order on the basic data type.public Interval1D(java.lang.Object point)
point - The only point the interval will contain.public Interval1D(Interval1D interval)
interval - The interval to be cloned.public Interval1D(Tree.Descriptor descriptor)
| Method Detail |
public java.lang.Object clone()
public java.lang.String toString()
public boolean equals(java.lang.Object object)
public java.lang.Object border(boolean rightBorder)
rightBorder - Returns the right border if true.public boolean includes(boolean rightBorder)
rightBorder - Examines the right border if true.
public int contains(java.lang.Object point)
throws java.lang.IllegalArgumentException
point - The point to be tested.
public boolean contains(Interval1D interval)
throws java.lang.IllegalArgumentException
interval - The interval to be tested.public boolean contains(Tree.Descriptor descriptor)
public int overlaps(Interval1D interval)
throws java.lang.IllegalArgumentException
interval - The interval to be tested.public boolean overlaps(Tree.Descriptor descriptor)
public Interval1D union(Interval1D interval)
throws java.lang.IllegalArgumentException
interval - The interval which defines the extension of this interval.public Tree.Descriptor union(Tree.Descriptor descriptor)
public Interval1D intersect(Interval1D interval)
throws java.lang.IllegalArgumentException
interval - The interval to be intersected with.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||