Class StateSetEnumerator
java.lang.Object
jflex.state.StateSetEnumerator
- All Implemented Interfaces:
Iterator<Integer>, PrimitiveIterator<Integer, IntConsumer>, PrimitiveIterator.OfInt
Enumerates the states of a
StateSet. Also provides an iterator for native int.- Version:
- JFlex 1.9.1
- Author:
- Gerwin Klein
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new StateSetEnumerator that is not yet associated with a StateSet.StateSetEnumerator(StateSet states) Construct a StateSetEnumerator for a given StateSet. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine if there are further elements in the set to be returned.booleanhasNext()Iterator interface method fornextElement().intReturn the next element from the set.intnextInt()Iterator interface method forhasMoreElements()voidReset this enumerator/iterator and associate it with a given StateSet.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PrimitiveIterator.OfInt
forEachRemaining, forEachRemaining, next
-
Constructor Details
-
StateSetEnumerator
public StateSetEnumerator()Creates a new StateSetEnumerator that is not yet associated with a StateSet.hasMoreElements()andnextElement()will throwNullPointerExceptionwhen used beforereset(StateSet) -
StateSetEnumerator
-
-
Method Details
-
reset
-
hasMoreElements
public boolean hasMoreElements()Determine if there are further elements in the set to be returned.- Returns:
- true iff there are more elements in the set.
-
nextElement
public int nextElement()Return the next element from the set.Precondition:
hasMoreElements()returns true- Returns:
- the next element.
- Throws:
NoSuchElementException- if there is no further element- See Also:
-
hasNext
public boolean hasNext()Iterator interface method fornextElement(). -
nextInt
public int nextInt()Iterator interface method forhasMoreElements()- Specified by:
nextIntin interfacePrimitiveIterator.OfInt
-