package listFW.visitor; import listFW.*; import listFW.factory.*; import listFW.visitor.*; /** * Returns the even-indexed elements of the host. * @author DXN */ public class OddIndexed implements IListAlgo { private IListFactory _fact; public OddIndexed(IListFactory f) { _fact = f; } public Object emptyCase(IEmptyList host, Object nu) { return host; } /** */ public Object nonEmptyCase(INEList host, Object input) { return host.getRest().execute(new EvenIndexed(_fact), null); } }