OOscheme.visitor
Class GetLength
java.lang.Object
OOscheme.visitor.GetLength
- All Implemented Interfaces:
- IListAlgo
public class GetLength
- extends Object
- implements IListAlgo
Computes the length of the IList host.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Singleton
public static final GetLength Singleton
- Singleton Pattern.
GetLength
private GetLength()
emptyCase
public Object emptyCase(IEmptyList host,
Object... nu)
- Returns Integer(0).
- Specified by:
emptyCase
in interface IListAlgo
- Parameters:
host
- an EmptyListnu
- not used
- Returns:
- Integer.
nonEmptyCase
public Object nonEmptyCase(INEList host,
Object... nu)
- Return the length of the host's rest plus 1.
- Specified by:
nonEmptyCase
in interface IListAlgo
- Parameters:
host
- an NEListnu
- not used.
- Returns:
- Integer