|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lrs.ANode<T> lrs.EmptyNode<T>
class EmptyNode<T>
Represents the empty state of a mutable list LRStruct. Uses the Singleton pattern.
Constructor Summary | |
---|---|
EmptyNode()
|
Method Summary | ||
---|---|---|
(package private)
|
execute(LRStruct<T> owner,
IAlgo<T,R,P> algo,
P... inp)
Calls the IAlgo visitor's empty case. |
|
(package private) T |
getFirst(LRStruct<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) LRStruct<T> |
getRest(LRStruct<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) LRStruct<T> |
insertFront(T dat,
LRStruct<T> owner)
The owner becomes non-empty and has dat as its first element. |
|
(package private) T |
removeFront(LRStruct<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) LRStruct<T> |
setFirst(T dat,
LRStruct<T> owner)
Throws java.util.NoSuchElementException. |
|
(package private) LRStruct<T> |
setRest(LRStruct<T> tail,
LRStruct<T> owner)
Throws java.util.NoSuchElementException. |
Methods inherited from class lrs.ANode |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
EmptyNode()
Method Detail |
---|
LRStruct<T> getRest(LRStruct<T> owner)
getRest
in class ANode<T>
owner
- the LRStruct referencing this ANode.
T getFirst(LRStruct<T> owner)
getFirst
in class ANode<T>
owner
- the LRStruct referencing this ANode.
LRStruct<T> setRest(LRStruct<T> tail, LRStruct<T> owner)
setRest
in class ANode<T>
tail
- the new tail for the owner LRStruct.owner
- the LRS referencing this ANode.
LRStruct
ownerLRStruct<T> setFirst(T dat, LRStruct<T> owner)
setFirst
in class ANode<T>
owner
- the LRS referencing this ANode.
LRStruct
ownerLRStruct<T> insertFront(T dat, LRStruct<T> owner)
insertFront
in class ANode<T>
dat
- the object to be inserted at the front.owner
- the LRS referencing this ANode.
LRStruct
ownerT removeFront(LRStruct<T> owner)
removeFront
in class ANode<T>
owner
- the LRS referencing this ANode.
<R,P> R execute(LRStruct<T> owner, IAlgo<T,R,P> algo, P... inp)
IAlgo
visitor's empty case.
execute
in class ANode<T>
owner
- the LRStruct referencing this ANode.algo
- the visitor algorithm to be executed.inp
- the inputs needed by the algorithm.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |