|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lrs.ANode lrs.EmptyNode
class EmptyNode
Represents the empty state of a mutable list LRStruct. Uses the Singleton pattern.
Field Summary | |
---|---|
(package private) static EmptyNode |
Singleton
Singleton Pattern. |
Constructor Summary | |
---|---|
private |
EmptyNode()
|
Method Summary | |
---|---|
(package private) java.lang.Object |
execute(IAlgo algo,
java.lang.Object inp,
LRStruct owner)
Calls the IAlgo visitor's empty case. |
(package private) java.lang.Object |
getFirst(LRStruct owner)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
getRest(LRStruct owner)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
insertFront(java.lang.Object dat,
LRStruct owner)
The owner becomes non-empty and has dat as its first element. |
(package private) java.lang.Object |
removeFront(LRStruct owner)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
setFirst(java.lang.Object dat,
LRStruct owner)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
setRest(LRStruct tail,
LRStruct 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 |
Field Detail |
---|
static final EmptyNode Singleton
Constructor Detail |
---|
private EmptyNode()
Method Detail |
---|
LRStruct getRest(LRStruct owner)
getRest
in class ANode
owner
- the LRStruct referencing this ANode.
java.lang.Object getFirst(LRStruct owner)
getFirst
in class ANode
owner
- the LRStruct referencing this ANode.
LRStruct setRest(LRStruct tail, LRStruct owner)
setRest
in class ANode
tail
- the new rest for the owner LRStruct.owner
- the LRS referencing this ANode.
LRStruct
ownerLRStruct setFirst(java.lang.Object dat, LRStruct owner)
setFirst
in class ANode
dat
- the new data object for this ANode.owner
- the LRS referencing this ANode.
LRStruct
ownerLRStruct insertFront(java.lang.Object dat, LRStruct owner)
insertFront
in class ANode
dat
- the object to be inserted at the front.owner
- the LRS referencing this ANode.
LRStruct
ownerjava.lang.Object removeFront(LRStruct owner)
removeFront
in class ANode
owner
- the LRS referencing this ANode.
java.lang.Object execute(IAlgo algo, java.lang.Object inp, LRStruct owner)
IAlgo
visitor's empty case.
execute
in class ANode
algo
- the visitor algorithm to be executed.inp
- the input needed by the algorithm.owner
- the LRStruct referencing this ANode.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |