/**
* Represents an abstract Scheme-like list, an immutable linear recursive
* structure of data. Has abstract methods to provide its internal data and
* structure to the client. Since an AList has an internal structure that is
* isomorphic to itself, it's best to implement it using the composite pattern.
* @author Dung X. Nguyen
* @version 1.1
* @since 01/25/02
* @Custom Copyright 2002 -All rights reserved
*/
public abstract class AList {
/**
* Returns the first element in this AList
, if any.
* The behavior for the empty list is undefined.
* @return behavior relegated to concrete subclasses.
*/
public abstract Object getFirst();
/**
* Returns the tail ("rest") of this AList
, if any.
* The behavior for the empty list is undefined.
* @return behavior relegated to concrete subclasses.
*/
public abstract AList getRest();
/**
* Computes and returns the number of elements in this AList.
* @return int >= 0.
*/
public abstract int getLength();
}