| 
|||||||||
| 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)  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 ANodeowner - the LRStruct referencing this ANode.
java.lang.Object getFirst(LRStruct owner)
getFirst in class ANodeowner - the LRStruct referencing this ANode.
LRStruct setRest(LRStruct tail,
                 LRStruct owner)
setRest in class ANodetail - the new rest for the owner LRStruct.owner - the LRS referencing this ANode.
LRStruct owner
LRStruct setFirst(java.lang.Object dat,
                  LRStruct owner)
setFirst in class ANodedat - the new data object for this ANode.owner - the LRS referencing this ANode.
LRStruct owner
LRStruct insertFront(java.lang.Object dat,
                     LRStruct owner)
insertFront in class ANodedat - the object to be inserted at the front.owner - the LRS referencing this ANode.
LRStruct ownerjava.lang.Object removeFront(LRStruct owner)
removeFront in class ANodeowner - 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 ANodealgo - 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 | ||||||||