|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectOOscheme.NEList
public class NEList
Concrete implementation of the non-empty list interface, INEList. Contains two pieces of data:
Field Summary | |
---|---|
private Object |
_first
The first data element of this NEList. |
private IList |
_rest
The rest or "tail" of this NEList. |
Constructor Summary | |
---|---|
NEList(Object first,
IList tail)
Initializes this NEList to a given first and rest. |
Method Summary | |
---|---|
Object |
execute(IListAlgo algo,
Object... inp)
Calls the nonEmptyCase method of the IListAlgo parameter, passing to this method itself as the host parameter and the given input as the input parameter. |
Object |
getFirst()
Returns the first data element of this NEList. |
IList |
getRest()
Returns the rest of this NEList. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Object _first
private IList _rest
Constructor Detail |
---|
public NEList(Object first, IList tail)
first
- the first data element of this NEList.tail
- != null, the rest of this NEList.Method Detail |
---|
public final Object getFirst()
getFirst
in interface INEList
public final IList getRest()
getRest
in interface INEList
public final Object execute(IListAlgo algo, Object... inp)
execute
in interface IList
algo
- the visitor, the algorithm to be executed.inp
- a variable number of input parameters to be used
by the algorithm algo.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |