|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcollectionframework.SimpleIntervalIndexedCollection<E>
public class SimpleIntervalIndexedCollection<E>
A collection of objects that is indexed by an interval That is, instead of a each element in the collection being associated with a single index i, each element is associated with a closed interval [a, b] NOTE: This is an easy implementation but not a good one. A better approach is to use an interval tree. See, for example, Cormen et al. (2001) and the references therein.
| Constructor Summary | |
|---|---|
SimpleIntervalIndexedCollection()
Default Constructor |
|
| Method Summary | |
|---|---|
void |
add(E element,
int left,
int right)
Add an element to this collection |
java.util.Iterator<E> |
get(int i)
Get all of the elements at point i (i.e., all of the elements with intervals that include i) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleIntervalIndexedCollection()
| Method Detail |
|---|
public void add(E element,
int left,
int right)
add in interface IntervalIndexedCollection<E>element - The element to addleft - The left-most point in the closed intervalright - The right-most point in the closed intervalpublic java.util.Iterator<E> get(int i)
get in interface IntervalIndexedCollection<E>i - The point of interest
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||