import tester.Traversal;
/** Interface for classes that represent a recursively defined list of
* items of the type T
... extends the
* Traversal
interface.
*/
interface ILoT
. */
class MtLoIllegalUseOfTraversalException
if the dataset is
* empty.
IllegalUseOfTraversalException
*/
public T getFirst(){
throw new IllegalUseOfTraversalException("No first element in an empty list");
}
/** Produce a {@link Traversal Traversal} for the rest of the
* dataset. Throws IllegalUseOfTraversalException
if
* the dataset is empty.
*
* @return the {@link Traversal Traversal} for the rest of
* this dataset if available - otherwise throws
* IllegalUseOfTraversalException
*/
public TraversalT
. */
class ConsLoIllegalUseOfTraversalException
if the dataset is
* empty.
*
* @return the first element if available -- otherwise throws
* IllegalUseOfTraversalException
*/
public T getFirst(){ return this.first; }
/** Produce a {@link Traversal Traversal} for the rest of the
* dataset. Throws IllegalUseOfTraversalException
if
* the dataset is empty.
*
* @return the {@link Traversal Traversal} for the rest of this
* dataset if available - otherwise throws
* IllegalUseOfTraversalException
*/
public Traversal