package clist; class EmptyNode extends ANode { public final static EmptyNode Singleton = new EmptyNode (); private EmptyNode () { } /** * @param owner * @return */ Object getDat (CLList owner) { throw new java.util.NoSuchElementException ("Null Node has no data"); } /** * @param owner * @return */ CLList setDat (Object dat, CLList owner) { throw new IllegalArgumentException ("Null Node has no data"); } /** * @param dat * @param owner */ CLList insertClockwise(Object dat, CLList owner) { new DatNode (dat, owner, owner); return owner; } /** * @param dat * @param owner */ CLList insertCounterwise(Object dat, CLList owner) { new DatNode (dat, owner, owner); return owner; } /** * @param owner * @return */ Object remClockwise(CLList owner) { throw new java.util.NoSuchElementException ("Null Node has no data"); } /** * @param owner * @return */ Object remCounterwise(CLList owner) { throw new java.util.NoSuchElementException ("Null Node has no data"); } /** * @param owner * @return */ CLList getClockwiseTail (CLList owner) { throw new java.util.NoSuchElementException ("Null Node has no clockwise tail"); } /** * @param owner * @return */ CLList getCounterwiseTail(CLList owner) { throw new java.util.NoSuchElementException ("Null Node has no counter clockwise tail."); } /** * @param algo * @param stop * @param input * @param owner * @return */ Object execute(ICLVisitor algo, CLList stop, Object input, CLList owner) { return algo.forEmpty (owner, stop, input); } /** * @param cllist */ void setClockwiseOwner(CLList cllist) { // do nothing. } /** * @param cllist */ void setCounterwiseOwner(CLList cllist) { // do nothing. } }