Class listFW.MTList


public class MTList
extends Object
implements listFW.IList
Represents the unique empty list using the singleton pattern. Provides concrete code for the execute method: simply calls the emptyCase method of the IListAlgo parameter, passing to this method itself as the host and the given input Object as the input.

Author:
D. X. Nguyen, S. B. Wong

Variable Index

 o Singleton
Singleton Pattern

Constructor Index

 o MTList ()

Method Index

 o execute (IListAlgo, Object)
Calls the empty case of the algorithm algo, passing to it itself as

Variables

 o Singleton
public static final MTList Singleton = new MTList()
Singleton Pattern

Constructors

 o MTList
private  MTList()

Methods

 o execute
public final Object execute(IListAlgo algo, Object inp)
Calls the empty case of the algorithm algo, passing to it itself as the host parameter and the given input inp as the input parameter. This method is marked as final to prevent all subclasses from overriding it. Finalizing a method also allows the compiler to generate more efficient calling code.