package rac; /** * This data-less concrete node in the doubly-linked circular list serves as a * "stop" point that defines a beginning and end of the list. This node is used * to enable visitor algorithms to traverse the list exactly once. It also * provides direct access to both the head and tail of the list. * @author S. Wong */ public class RACStopNode extends ARACNode { public RACStopNode() { next = this; previous = this; } /** * This method will double dispatch to the stopCase() method of the supplied * visitor algorithm. * @param param A parameter for the algorithm to use. * @param visitor A visitor algorithm. * @return The return value of the algoirthm. */ public Object execute(IRACVisitor visitor, Object param) { return visitor.stopCase(this, param); } /** * This node cannot be removed. A null pointer is always returned. * @return null always. */ public Object removeNode() { return null; } }