package scheme2.visitor; import scheme2.AListFW; import scheme2.IListAlgo; public class GetSum implements IListAlgo { /** @SBGen Singleton Variable */ public final static GetSum Singleton = new GetSum (); /** @SBGen Constructor */ private GetSum() { } /** * @param host * @param input not used. * @return */ public Object forEmpty(AListFW host, Object input) { return new Integer (0); // Empty Range Axiom! } /** * @param host * @param input not used. * @return */ public Object forNonEmpty(AListFW host, Object input) { return host.getRest ().execute (new HelpGetSum (((Integer)host.getFirst()).intValue ()), null); } }