package edu.rice.cs.dxn.QFList; /** * Mutable quasi-functional linear recursive structure. * @author Dung X. Nguyen Copyright 1999 - All rights reserved. * @since 10/21/99 */ public class QFList { /** @SBGen Variable (,head,,128) */ private IState _head; /** @SBGen Constructor */ public QFList () { _head = NullNode.singleton; } /** * @param dat data to insert at this node */ public final void insertFront (Object dat) { _head.insertFront (dat, this); } /** * @return Returns this node's first */ public final Object removeFront () { return _head.removeFront (this); } /** * @return Gets the data from this node */ public final Object getFirst() { return _head.getFirst (this); } /** * @param dat new data for this node */ public final void setFirst (Object dat) { _head.setFirst (dat, this); } /** * @return gets the rest of the structure */ public final QFList getRest () { return _head.getRest (this); } /** * @param tail sets a new tail for this node */ public final void setRest (QFList tail) { _head.setRest (tail, this); } public final Object execute (IAlgo visitor, Object input) { return _head.execute (visitor, input, this); } // Package access only: /** * Initiazes this QFList with a given head node. * @param node null != node. */ QFList (IState node) { _head = node; } /** * @param head */ final void setHead (IState head) { _head = head; } /** * @return */ final IState getHead () { return (_head); } }