stresstests.interfaces
Interface Traversal<T>

All Known Implementing Classes:
TraversalALC, TraversalInFile, TraversalList, TraversalOutFile

public interface Traversal<T>

An interface that defines a functional iterator for traversing datasets

Since:
30 May 2007
Author:
Viera K. Proulx

Method Summary
 T getFirst()
          Produce the first element in the dataset represented by this Traversal
 Traversal<T> getRest()
          Produce a Traversal for the rest of the dataset
 boolean isEmpty()
          Produce true if this Traversal represents an empty dataset
 

Method Detail

isEmpty

boolean isEmpty()
Produce true if this Traversal represents an empty dataset

Returns:
true if the dataset is empty

getFirst

T getFirst()
           throws IllegalUseOfTraversalException

Produce the first element in the dataset represented by this Traversal

Throws IllegalUseOfTraversalException if the dataset is empty.

Returns:
the first element if available -- otherwise throws IllegalUseOfTraversalException
Throws:
IllegalUseOfTraversalException

getRest

Traversal<T> getRest()
                     throws IllegalUseOfTraversalException

Produce a Traversal for the rest of the dataset

Throws IllegalUseOfTraversalException if the dataset is empty.

Returns:
the Traversal for the rest of this dataset if available -- otherwise throws IllegalUseOfTraversalException
Throws:
IllegalUseOfTraversalException