package scheme2.visitor; import scheme2.*; class HelpGetSum implements IListAlgo { private int _accSum; /** @SBGen Constructor */ public HelpGetSum(int accSum) { _accSum = accSum; } /** * @param host * @param input not used * @return */ public Object forEmpty(AListFW host, Object input) { return new Integer (_accSum); } /** * @param host * @param input not used * @return */ public Object forNonEmpty(AListFW host, Object input) { _accSum += ((Integer)host.getFirst ()).intValue (); return host.getRest ().execute (this, null); } }