|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlrs.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) Object |
execute(LRStruct owner,
IAlgo algo,
Object... inp)
Calls the IAlgo visitor's empty case. |
(package private) Object |
getFirst(LRStruct owner)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
getRest(LRStruct owner)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
insertFront(LRStruct owner,
Object dat)
The owner becomes non-empty and has dat as its first element. |
(package private) Object |
removeFront(LRStruct owner)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
setFirst(LRStruct owner,
Object dat)
Throws java.util.NoSuchElementException. |
(package private) LRStruct |
setRest(LRStruct owner,
LRStruct tail)
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.
Object getFirst(LRStruct owner)
getFirst
in class ANode
owner
- the LRStruct referencing this ANode.
LRStruct setRest(LRStruct owner, LRStruct tail)
setRest
in class ANode
owner
- the LRS referencing this ANode.tail
- the new tail for the owner LRStruct.
LRStruct
ownerLRStruct setFirst(LRStruct owner, Object dat)
setFirst
in class ANode
owner
- the LRS referencing this ANode.dat
- the new data object for this ANode.
LRStruct
ownerLRStruct insertFront(LRStruct owner, Object dat)
insertFront
in class ANode
owner
- the LRS referencing this ANode.dat
- the object to be inserted at the front.
LRStruct
ownerObject removeFront(LRStruct owner)
removeFront
in class ANode
owner
- the LRS referencing this ANode.
Object execute(LRStruct owner, IAlgo algo, Object... inp)
IAlgo
visitor's empty case.
execute
in class ANode
owner
- the LRS referencing this ANode.algo
- the visitor algorithm to be executed.inp
- the input needed by the algorithm.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |