package clist; class NullNode extends ANode { /** * Singleton pattern */ public final static NullNode Singleton = new NullNode(); private NullNode() { } Object getDat(CLList parent) { throw new java.util.NoSuchElementException("Null Node has no data"); } void setDat(Object dat, CLList parent) { throw new java.util.NoSuchElementException("Null Node has no data"); } CLList getClockwiseTail(CLList parent) { throw new java.util.NoSuchElementException("Null Node has no clockwise tail"); } CLList getCounterwiseTail(CLList parent) { throw new java.util.NoSuchElementException("Null Node has no counter clockwise tail."); } void insertClockwise(Object dat, CLList parent) { new DatNode(dat, parent, parent); } void insertCounterwise(Object dat, CLList parent) { new DatNode(dat, parent, parent); } Object removeClockwise(CLList parent) { throw new java.util.NoSuchElementException("Null Node has no data"); } Object removeCounterwise(CLList parent) { throw new java.util.NoSuchElementException("Null Node has no data"); } Object execClockwise(ICLVisitor algo, CLList start, Object input, CLList parent) { return algo.nullCase(parent, start, input); } Object execCounterwise(ICLVisitor algo, CLList start, Object input, CLList parent) { return algo.nullCase(parent, start, input); } void setClockwiseParent(CLList cllist) { // do nothing. } void setCounterwiseParent(CLList cllist) { // do nothing. } }