package clist; public class CLList { private ANode _clockwiseHead; private ANode _counterwiseHead; public CLList() { _clockwiseHead = NullNode.Singleton; _counterwiseHead = NullNode.Singleton; } public Object getClockwiseDat() { return _clockwiseHead.getDat(this); } public void setClockwiseDat(Object dat) { _clockwiseHead.setDat(dat, this); } public CLList getClockwiseTail() { return _clockwiseHead.getClockwiseTail(this); } public Object getCounterwiseDat() { return _counterwiseHead.getDat(this); } public void setCounterwiseDat(Object dat) { _counterwiseHead.setDat(dat, this); } public CLList getCounterwiseTail() { return _counterwiseHead.getCounterwiseTail(this); } public void insertClockwise(Object dat) { _clockwiseHead.insertClockwise(dat, this); } public void insertCounterwise(Object dat) { _counterwiseHead.insertCounterwise(dat, this); } public Object removeClockwise() { return _clockwiseHead.removeClockwise(this); } public Object removeCounterwise() { return _counterwiseHead.removeCounterwise(this); } public Object execClockwise(ICLVisitor algo, CLList start, Object input) { return _clockwiseHead.execClockwise(algo, start, input, this); } public Object execCounterwise(ICLVisitor algo, CLList start, Object input) { return _counterwiseHead.execCounterwise(algo, start, input, this); } // Package access only: CLList(ANode counterwiseHead, ANode clockwiseHead) { _clockwiseHead = clockwiseHead; _clockwiseHead.setCounterwiseParent(this); _counterwiseHead = counterwiseHead; _counterwiseHead.setClockwiseParent(this); } ANode getClockwiseHead() { return _clockwiseHead; } void setClockwiseHead(ANode node) { _clockwiseHead = node; _clockwiseHead.setCounterwiseParent(this); } ANode getCounterwiseHead() { return _counterwiseHead; } void setCounterwiseHead(ANode node) { _counterwiseHead = node; _counterwiseHead.setClockwiseParent(this); } }