EmptyList.java
Created with JBuilder

/**
 * Represents the empty list.
 * @author Dung X. Nguyen
 * @version 1.0
 * @since 01/22/02
 * @Custom Copyright 2002 -All rights reserved
 */
public class EmptyList extends AList {
    /**
     * Throws an IllegalArgumentException.
     * @return does not return.
     * @exception IllegalArgumentException.
     */
    public Object getFirst() {
        throw new IllegalArgumentException ("EmptyList has no first!");
    }

    /**
     * Throws an IllegalArgumentException
     * @return does not return.
     * @exception IllegalArgumentException.
     */
    public AList getRest() {
        throw new IllegalArgumentException ("EmptyList has no rest!");
    }

    /**
     * Returns the null String.
     * @return "".
     */
    public String toString() {
        return "";
    }
}



EmptyList.java
Created with JBuilder