tester
Interface Traversal<T>


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

getFirst

T getFirst()

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

getRest

Traversal<T> getRest()

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

isEmpty

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

Returns:
true if the dataset is empty