| |
|
| java.lang.Object javax.media.jai.IntegerSequence
IntegerSequence | public class IntegerSequence extends Object (Code) | | 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 | |
public | IntegerSequence(int min, int max) Constructs a sequence bounded by an inclusive range of values. | public | IntegerSequence() Constructs a sequence that may contain any integer value. |
Method Summary | |
public int | getNumElements() Returns the number of elements contained within this IntegerSequence . | public boolean | hasMoreElements() Returns true if more elements are available to be iterated over. | public void | insert(int element) Inserts an integer into the sequence. | public int | nextElement() Returns the next element of the iteration in ascending order. | public void | startEnumeration() Resets the iterator to the beginning of the sequence. | public String | toString() Returns a String representation of the sequence. |
IntegerSequence | public IntegerSequence(int min, int max)(Code) | | Constructs a sequence bounded by an inclusive range of values.
Parameters: min - Lower bound of the valid integer range. Parameters: max - Upper bound of the valid integer range. throws: IllegalArgumentException - if min > max. |
IntegerSequence | public IntegerSequence()(Code) | | Constructs a sequence that may contain any integer value.
|
getNumElements | public int getNumElements()(Code) | | Returns the number of elements contained within this IntegerSequence .
|
hasMoreElements | public boolean hasMoreElements()(Code) | | Returns true if more elements are available to be iterated over.
|
insert | public void insert(int element)(Code) | | Inserts an integer into the sequence. If the value falls out
of the desired range, it will be silently rejected. Inserting
an element that is already a member of the sequence has no
effect.
Parameters: element - The int to be inserted. |
nextElement | public int nextElement()(Code) | | Returns the next element of the iteration in ascending order.
If the end of the array has been reached, a
java.util.NoSuchElementException will be thrown.
throws: NoSuchElementException - if the end of the array hasbeen reached. |
startEnumeration | public void startEnumeration()(Code) | | Resets the iterator to the beginning of the sequence.
|
toString | public String toString()(Code) | | Returns a String representation of the sequence.
|
|
|
|