OOscheme.visitor
Class GetMinHelper

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

public class GetMinHelper
extends Object
implements IListAlgo


Field Summary
static GetMinHelper Singleton
          Singleton Pattern.
 
Constructor Summary
private GetMinHelper()
           
 
Method Summary
 Object emptyCase(IEmptyList host, Object... inp)
          Returns inp[0].
 Object nonEmptyCase(INEList host, Object... inp)
          Recurs by passing the mimum between the host's first and inp, the accumulated current minimum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Singleton

public static final GetMinHelper Singleton
Singleton Pattern.

Constructor Detail

GetMinHelper

private GetMinHelper()
Method Detail

emptyCase

public Object emptyCase(IEmptyList host,
                        Object... inp)
Returns inp[0].

Specified by:
emptyCase in interface IListAlgo
Parameters:
host - an empty list
inp - Integer[] inp[0] is the minimum of the preceding list.
Returns:
Integer

nonEmptyCase

public Object nonEmptyCase(INEList host,
                           Object... inp)
Recurs by passing the mimum between the host's first and inp, the accumulated current minimum.

Specified by:
nonEmptyCase in interface IListAlgo
Parameters:
host - a non-empty list
inp - Integer[] inp[0] is the minimum of the preceding list.
Returns:
Integer