|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.IntegerSequence
A growable sorted integer set. Adding an integer to the sequence results in it being placed into the sequence in sorted order. Adding an integer that is already part of the sequence has no effect.
This structure is used by various subclasses of
OpImage
to keep track of horizontal and vertical
source splits. Each instance of IntegerSequence provides an
internal enumeration by means of which the elements of the sequence
may be accessed in order. The enumerator is initialized by the
startEnumeration
method, and the
hasMoreElements
and nextElement
methods
allow looping through the elements. Only one enumeration at a time
is supported. Calling insert()
from multiple threads
is not supported.
Constructor Summary | |
IntegerSequence()
Constructs a sequence that may contain any integer value. |
|
IntegerSequence(int min,
int max)
Constructs a sequence bounded by an inclusive range of values. |
Method Summary | |
int |
getNumElements()
Returns the number of elements contained within this IntegerSequence . |
boolean |
hasMoreElements()
Returns true if more elements are available to be iterated over. |
void |
insert(int element)
Inserts an integer into the sequence. |
int |
nextElement()
Returns the next element of the iteration in ascending order. |
void |
startEnumeration()
Resets the iterator to the beginning of the sequence. |
String |
toString()
Returns a String representation of the sequence. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public IntegerSequence(int min, int max)
min
- Lower bound of the valid integer range.max
- Upper bound of the valid integer range.public IntegerSequence()
Method Detail |
public void insert(int element)
element
- The int
to be inserted.public void startEnumeration()
public boolean hasMoreElements()
public int nextElement()
java.util.NoSuchElementException will be thrown.
- Throws:
- NoSuchElementException - if the end of the array has
been reached.
public int getNumElements()
IntegerSequence
.public String toString()
String
representation of the sequence.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |