Class schemeFW.NEList
- public class NEList
- extends Object
- implements schemeFW.INEList
Represents a non-empty list.
Implemented as a composite.
- Author:
- Dung X. Nguyen, Dung X. Nguyen, Stephen B. Wong
- Version:
- 1.1

_first
- This
NEList's first
_rest
- This
NEList's rest

NEList
(Object, IList)
- Initializes this
NEList to the given first and rest

execute
(IListAlgo, Object)
- Calls the
nonEmptyCase() method of the supplied IListAlgo
getFirst
()
- Accessor method for this
NEList's first
getRest
()
- Accessor method for this
NEList's rest

_first
private Object _first
- This
NEList's first.
_rest
private IList _rest
- This
NEList's rest

NEList
public NEList(Object dat, IList tail)
- Initializes this
NEList to the given first and rest.
- Parameters:
- dat - the first data element of this
NEList.- tail - the rest of this AList.

getFirst
public Object getFirst()
- Accessor method for this
NEList's first.
- Returns:
Object the first element of this NEList.
getRest
public IList getRest()
- Accessor method for this
NEList's rest.
- Returns:
IList the rest of this NEList.
execute
public Object execute(IListAlgo algo, Object inp)
- Calls the
nonEmptyCase() method of the supplied IListAlgo
with the supplied input parameter.
- Parameters:
- algo - The visitor algorithm to be executed.
- inp - input to be handed to algo's
nonEmptyCase(). - Returns:
Object output of algo's nonEmptyCase().