package schemeFW; /** * Represents the empty list. * Implemented as a singleton, using the singleton pattern. * @author Dung X. Nguyen * @author Stephen B. Wong * @version 1.1 * @since 09/10/01 * @Custom Copyright 2001 -All rights reserved */ public class EmptyList implements IEmptyList { public final static EmptyList Singleton = new EmptyList (); private EmptyList() { // NOTE: the constructor is private so that no external client can // instantiate an EmptyList. } /** * Calls the emptyCase() method of the supplied IListAlgo * with the supplied input parameter. * @param algo The visitor algorithm to be executed. * @param inp input to be handed to the algo's emptyCase(). * @return Object output of algo's emptyCase(). */ public Object execute(IListAlgo algo, Object inp) { return algo.emptyCase(this, inp); } }