package scheme2.visitor; import scheme2.AListFW; import scheme2.IListAlgo; public class Length implements IListAlgo { /** @SBGen Singleton Variable */ public final static Length Singleton = new Length (); /** @SBGen Constructor */ private Length() { } /** * @param host * @param input not used * @return */ public Object forEmpty(AListFW host, Object input) { return new Integer (0); } /** * @param host * @param input not used * @return */ public Object forNonEmpty(AListFW host, Object input) { return new Integer (1 + ((Integer)host.getRest ().execute (this, null)).intValue ()); } }