de.jstacs.data
Class Sample.ElementEnumerator

java.lang.Object
  extended by 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

Constructor Summary
Sample.ElementEnumerator(Sample data)
          Creates a new Sample.ElementEnumerator on the given Sample data.
 
Method Summary
 boolean hasMoreElements()
           
 boolean hasNext()
           
 Sequence next()
           
 Sequence nextElement()
           
 void remove()
           
 void reset()
          This method enables the user to reuse this enumerator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sample.ElementEnumerator

public Sample.ElementEnumerator(Sample data)
Creates a new Sample.ElementEnumerator on the given Sample data.

Parameters:
data - the given Sample
Method Detail

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>