OOscheme.visitor
Class GetMin

java.lang.Object
  extended by OOscheme.visitor.GetMin
All Implemented Interfaces:
IListAlgo

public class GetMin
extends Object
implements IListAlgo

Assumes the AList host contains Integer, computes the minimum of the all the Integer objects in the host.


Field Summary
static GetMin Singleton
          Singleton Pattern.
 
Constructor Summary
private GetMin()
           
 
Method Summary
 Object emptyCase(IEmptyList host, Object... nu)
          Throws an IllegalArgumentException.
 Object nonEmptyCase(INEList host, Object... nu)
          Passes the host's data to the host's rest and asks for help to compute the minimum element in the host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Singleton

public static final GetMin Singleton
Singleton Pattern.

Constructor Detail

GetMin

private GetMin()
Method Detail

emptyCase

public Object emptyCase(IEmptyList host,
                        Object... nu)
Throws an IllegalArgumentException.

Specified by:
emptyCase in interface IListAlgo
Parameters:
host - an EmptyList
nu - not used
Returns:
does not return.
Throws:
IllegalArgumentException

nonEmptyCase

public Object nonEmptyCase(INEList host,
                           Object... nu)
Passes the host's data to the host's rest and asks for help to compute the minimum element in the host.

Specified by:
nonEmptyCase in interface IListAlgo
Parameters:
host - an NEList
nu - not used
Returns:
Integer