listFW
Class ToStringHelper

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

 class ToStringHelper
extends Object
implements IListAlgo

Helps ToStringAlgo compute the String representation of the rest of the list.


Field Summary
static ToStringHelper Singleton
           
 
Method Summary
 Object emptyCase(IMTList host, Object acc)
          Returns the accumulated String + ")".
 Object nonEmptyCase(INEList host, Object acc)
          Continues accumulating the String representation by appending ", " + first to acc and recur!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Singleton

public static final ToStringHelper Singleton
Method Detail

emptyCase

public Object emptyCase(IMTList host,
                        Object acc)
Returns the accumulated String + ")". At end of list: done!

Specified by:
emptyCase in interface IListAlgo
Parameters:
host - the IMTList that is executing this algorithm.
acc - 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 acc)
Continues accumulating the String representation by appending ", " + first to acc and recur!

Specified by:
nonEmptyCase in interface IListAlgo
Parameters:
host - the INEList that is executing this algorithm
acc - 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.