OOscheme.visitor
Class GetMinHelper
java.lang.Object
OOscheme.visitor.GetMinHelper
- All Implemented Interfaces:
- IListAlgo
public class GetMinHelper
- extends Object
- implements IListAlgo
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Singleton
public static final GetMinHelper Singleton
- Singleton Pattern.
GetMinHelper
private GetMinHelper()
emptyCase
public Object emptyCase(IEmptyList host,
Object... inp)
- Returns inp[0].
- Specified by:
emptyCase
in interface IListAlgo
- Parameters:
host
- an empty listinp
- 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 listinp
- Integer[] inp[0] is the minimum of the preceding list.
- Returns:
- Integer