E
- the type of objected stored in this
public interface IntIntervalTree<E extends IntInterval>
IntIntervalTree
represents an interval
tree whose elements are IntInterval
objects.Modifier and Type | Method and Description |
---|---|
boolean |
add(E element)
Adds the specified element to this interval tree, and returns
true if the interval tree is changed as a result of
the call. |
void |
clear()
Removes all of the elements from this interval tree.
|
boolean |
contains(E element)
Returns
true if the interval tree contains the specified
element, and returns false otherwise. |
int |
end()
Returns the maximum end (inclusive) of an interval
that can be stored in this interval tree.
|
void |
intersect(int point,
java.util.Collection<E> collection)
Adds the elements in this interval tree that intersect the specified
point to the specified collection.
|
void |
intersectAll(int start,
int end,
java.util.Collection<E> collection)
Adds the elements in this interval tree that contain
the specified interval to the specified collection.
|
void |
intersectPart(int start,
int end,
java.util.Collection<E> collection)
Adds the elements in this interval tree that intersect any part of
the specified interval to the specified collection.
|
boolean |
isEmpty()
Returns
true if this interval tree contains no elements. |
boolean |
remove(E element)
Removes the specified element from this interval tree if the
specified element is found in the interval tree.
|
int |
size()
Returns the number of elements in this interval tree.
|
int |
start()
Returns the minimum start (inclusive) of an interval
that can be stored in this interval tree.
|
E[] |
toArray()
Returns an array containing all of the elements of this interval tree.
|
int start()
int end()
void clear()
boolean add(E element)
true
if the interval tree is changed as a result of
the call. The method returns false
if
this.contains(E) == true
when the method is invoked.element
- the element to be addedtrue
if the interval tree changed as
a result of the calljava.lang.IllegalArgumentException
- if
element.start() < this.start() || element.end() > this.end()
java.lang.NullPointerException
- if element == null
boolean contains(E element)
true
if the interval tree contains the specified
element, and returns false
otherwise.element
- the element whose presence in the interval tree
is to be testedtrue
if the interval tree contains the specified
elementjava.lang.NullPointerException
- if element == null
boolean remove(E element)
element
- the element to be removed from this interval treetrue
if the interval tree is changed as
a result of the calljava.lang.NullPointerException
- if element == null
void intersect(int point, java.util.Collection<E> collection)
point
- a pointcollection
- a collection to which will be added the elements of
this interval tree that intersect the specified pointjava.lang.NullPointerException
- if collection == null
void intersectPart(int start, int end, java.util.Collection<E> collection)
start
- the start (inclusive) of the specified intervalend
- the end (inclusive) of the specified intervalcollection
- a collection to which will be added the elements of
this interval tree that intersect any part of the specified intervaljava.lang.NullPointerException
- if collection == null
.void intersectAll(int start, int end, java.util.Collection<E> collection)
start
- the start (inclusive) of the specified intervalend
- the end (inclusive) of the specified intervalcollection
- a collection to which will be added the elements
of this interval tree that contain the specified intervaljava.lang.NullPointerException
- if collection == null
boolean isEmpty()
true
if this interval tree contains no elements.true
if this interval tree contains no elementsint size()
E[] toArray()