lrs.visitor
Class GetLength

java.lang.Object
  extended by lrs.visitor.GetLength
All Implemented Interfaces:
IAlgo

public class GetLength
extends java.lang.Object
implements IAlgo

Return the length of the list.

Author:
Mathias Ricken

Field Summary
static GetLength Singleton
           
 
Constructor Summary
private GetLength()
           
 
Method Summary
 java.lang.Object emptyCase(LRStruct host, java.lang.Object inp)
          Operates on an empty LRStruct host, given an input object.
 java.lang.Object nonEmptyCase(LRStruct host, java.lang.Object inp)
          Operates on a non-empty LRStruct host, given an input object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Singleton

public static final GetLength Singleton
Constructor Detail

GetLength

private GetLength()
Method Detail

emptyCase

public java.lang.Object emptyCase(LRStruct host,
                                  java.lang.Object inp)
Operates on an empty LRStruct host, given an input object.

Specified by:
emptyCase in interface IAlgo
Parameters:
host - an empty LRStruct.
inp - unused
Returns:
length of the list

nonEmptyCase

public java.lang.Object nonEmptyCase(LRStruct host,
                                     java.lang.Object inp)
Operates on a non-empty LRStruct host, given an input object.

Specified by:
nonEmptyCase in interface IAlgo
Parameters:
host - a non-empty LRStruct.
inp - unused
Returns:
an length of the list