package scheme2.visitor; import scheme2.*; public class HelpGetMin implements IListAlgo { private int _tempMin; /** * @param tempMin */ public HelpGetMin(int tempMin) { _tempMin = tempMin; } /** * @param host * @param input not used * @return */ public Object forEmpty(AListFW host, Object input) { return new Integer (_tempMin); } /** * @param host * @param input not used * @return */ public Object forNonEmpty(AListFW host, Object input) { int i = ((Integer)host.getFirst ()).intValue (); if (i < _tempMin) { _tempMin = i; } return host.getRest ().execute(this, null); } }