listFW
Class ToStringAlgo

java.lang.Object
  extended by listFW.ToStringAlgo
All Implemented Interfaces:
IListAlgo

public class ToStringAlgo
extends Object
implements IListAlgo

Computes a String reprsentation of IList showing a left parenthesis followed by elements of the IList separated by commas, ending with with a right parenthesis.

Since:
02/27/2004
Author:
D.X. Nguyen

Field Summary
static ToStringAlgo Singleton
           
 
Method Summary
 Object emptyCase(IMTList host, Object inp)
          Returns "()".
 Object nonEmptyCase(INEList host, Object inp)
          Passes "(" + first to the rest of IList and asks for help to complete the computation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Singleton

public static final ToStringAlgo Singleton
Method Detail

emptyCase

public Object emptyCase(IMTList host,
                        Object inp)
Returns "()".

Specified by:
emptyCase in interface IListAlgo
Parameters:
host - the IMTList that is executing this algorithm.
inp - generic input parameter that can be used for any purpose.
Returns:
result from calling this method. The type of the result is problem-specific and may be null.

nonEmptyCase

public Object nonEmptyCase(INEList host,
                           Object inp)
Passes "(" + first to the rest of IList and asks for help to complete the computation.

Specified by:
nonEmptyCase in interface IListAlgo
Parameters:
host - the INEList that is executing this algorithm
inp - generic input parameter that can be used for any purpose.
Returns:
result from calling this method. The type of the result is problem-specific and may be null.