de.jstacs.data
Class Sample.ElementEnumerator

java.lang.Object
  extended by de.jstacs.data.Sample.ElementEnumerator
All Implemented Interfaces:
Enumeration<Sequence>
Enclosing class:
Sample

public static class Sample.ElementEnumerator
extends Object
implements Enumeration<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()
           
 Sequence nextElement()
           
 void reset()
          Restarts the enumeration.
 
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()
Restarts the enumeration.