package clist.visitor; import clist.*; public class Stub implements IAlgo { private CList _stop; public Stub(CList stop) { _stop = stop; } public Object emptyCase(CList host, Object input) { // ... return null; // dummy value for stub } /** * Needs to distinguish the case when the host has one element * from the case when the host has more than one element. */ public Object nonEmptyCase(CList host, Object input) { // stub assumes Clockwise, can change consistently for CounterClockwise CList tail = host.getRestClockwise(); if (tail == _stop) { // something using host.getFirstClockwise() } else { // something using host.getFirstClockwise() // something using tail.executeClockwise(this, input); } return null; // dummy value for stub } }