de.jstacs.data
Class Sample.ElementEnumerator
java.lang.Object
de.jstacs.data.Sample.ElementEnumerator
- All Implemented Interfaces:
- RecyclableSequenceEnumerator, Enumeration<Sequence>, Iterator<Sequence>
- Enclosing class:
- Sample
public static class Sample.ElementEnumerator
- extends Object
- implements RecyclableSequenceEnumerator, Iterator<Sequence>
This class can be used to have a fast sequential access to a
Sample
. It enumerates all elements
of a Sample
.
As further functionality the method reset()
is implemented to
reuse an Sample.ElementEnumerator
.
- Author:
- Jens Keilwagen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Sample.ElementEnumerator
public Sample.ElementEnumerator(Sample data)
- Creates a new
Sample.ElementEnumerator
on the given Sample
data
.
- Parameters:
data
- the given Sample
hasMoreElements
public boolean hasMoreElements()
- Specified by:
hasMoreElements
in interface Enumeration<Sequence>
nextElement
public Sequence nextElement()
- Specified by:
nextElement
in interface Enumeration<Sequence>
reset
public void reset()
- Description copied from interface:
RecyclableSequenceEnumerator
- This method enables the user to reuse this enumerator.
- Specified by:
reset
in interface RecyclableSequenceEnumerator
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<Sequence>
next
public Sequence next()
- Specified by:
next
in interface Iterator<Sequence>
remove
public void remove()
- Specified by:
remove
in interface Iterator<Sequence>