listFW.visitor
Class ToStringAlgo
java.lang.Object
listFW.visitor.ToStringAlgo
- All Implemented Interfaces:
- IListAlgo<Object,String,Object>
public class ToStringAlgo
- extends Object
- implements IListAlgo<Object,String,Object>
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.
This code has been written to make it run on any list.
- Since:
- 07/01/2004
- Author:
- D.X. Nguyen, S. Wong
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Singleton
public static final ToStringAlgo Singleton
ToStringAlgo
private ToStringAlgo()
emptyCase
public String emptyCase(IMTList<? extends Object> host,
Object... inp)
- Returns "()".
- Specified by:
emptyCase
in interface IListAlgo<Object,String,Object>
nonEmptyCase
public String nonEmptyCase(INEList<? extends Object> host,
Object... inp)
- Passes "(" + first to the rest of IList and asks for help to complete the computation.
- Specified by:
nonEmptyCase
in interface IListAlgo<Object,String,Object>