A E G I L N R S T _

A

ANode<T> - Class in lrs
Represents the abstract list state.
ANode() - Constructor for class lrs.ANode
 

E

emptyCase(LRStruct<T>, P...) - Method in interface lrs.IAlgo
Operates on an empty LRStruct host, given an input object.
emptyCase(LRStruct<T>, T...) - Method in class lrs.visitor.InsertInOrder
Simply inserts the given parameter n at the front.
EmptyNode<T> - Class in lrs
Represents the empty state of a mutable list LRStruct.
EmptyNode() - Constructor for class lrs.EmptyNode
 
execute(LRStruct<T>, IAlgo<T, R, P>, P...) - Method in class lrs.ANode
Executes a visitor algorithm and returns the output.
execute(LRStruct<T>, IAlgo<T, R, P>, P...) - Method in class lrs.EmptyNode
Calls the IAlgo visitor's empty case.
execute(IAlgo<T, R, P>, P...) - Method in class lrs.LRStruct
Hook method to execute an algorithm with a given input and return an appropriate output object.
execute(LRStruct<T>, IAlgo<T, R, P>, P...) - Method in class lrs.NENode
Calls the visitor's non-empty case.

G

getFirst(LRStruct<T>) - Method in class lrs.ANode
Returns the first data object of the referencing LRStruct.
getFirst(LRStruct<T>) - Method in class lrs.EmptyNode
Throws java.util.NoSuchElementException.
getFirst() - Method in class lrs.LRStruct
Gets the first data element from this LRStruct
getFirst(LRStruct<T>) - Method in class lrs.NENode
 
getHead() - Method in class lrs.LRStruct
Gets the head node (i.e.
getRest(LRStruct<T>) - Method in class lrs.ANode
Returns the tail LRStruct of the referencing LRStruct.
getRest(LRStruct<T>) - Method in class lrs.EmptyNode
Throws java.util.NoSuchElementException.
getRest() - Method in class lrs.LRStruct
Gets the rest of this LRStruct.
getRest(LRStruct<T>) - Method in class lrs.NENode
 

I

IAlgo<T,R,P> - Interface in lrs
Represents an abstract algorithm on an LRStruct.
insertFront(T, LRStruct<T>) - Method in class lrs.ANode
Inserts a data object at the front of the LRStruct owner.
insertFront(T, LRStruct<T>) - Method in class lrs.EmptyNode
The owner becomes non-empty and has dat as its first element.
insertFront(T) - Method in class lrs.LRStruct
Inserts dat to the front of this LRStruct.
post condition: getFirst() now returns dat.
insertFront(T, LRStruct<T>) - Method in class lrs.NENode
Inserts a data object at the front of the LRStruct owner.
InsertInOrder<T> - Class in lrs.visitor
Algorithm for inserting elements into an LRStruct in order.
InsertInOrder(Comparator<T>) - Constructor for class lrs.visitor.InsertInOrder
 

L

lrs - package lrs
 
lrs.visitor - package lrs.visitor
 
LRStruct<T> - Class in lrs
Mutable linear recursive structure.
LRStruct() - Constructor for class lrs.LRStruct
Initializes this LRStruct to the empty state.
LRStruct(ANode<T>) - Constructor for class lrs.LRStruct
Initiazes this LRStruct with a given head node.

N

NENode<T> - Class in lrs
Represents the non-empty state of a LStruct.
NENode(T, LRStruct<T>) - Constructor for class lrs.NENode
Initializes this NENode to contain dat and a given tail list.
nonEmptyCase(LRStruct<T>, P...) - Method in interface lrs.IAlgo
Operates on a non-empty LRStruct host, given an input object.
nonEmptyCase(LRStruct<T>, T...) - Method in class lrs.visitor.InsertInOrder
Based on the comparison between first and n, inserts at the front or recurs!

R

removeFront(LRStruct<T>) - Method in class lrs.ANode
Removes and returns the first data object for the referencing LRStruct.
removeFront(LRStruct<T>) - Method in class lrs.EmptyNode
Throws java.util.NoSuchElementException.
removeFront() - Method in class lrs.LRStruct
Removes and returns this LRStruct's first.
removeFront(LRStruct<T>) - Method in class lrs.NENode
 

S

setFirst(T, LRStruct<T>) - Method in class lrs.ANode
Sets a new first data object for the referencing LRStruct.
setFirst(T, LRStruct<T>) - Method in class lrs.EmptyNode
Throws java.util.NoSuchElementException.
setFirst(T) - Method in class lrs.LRStruct
Sets first data element to a new value.
setFirst(T, LRStruct<T>) - Method in class lrs.NENode
 
setHead(ANode<T>) - Method in class lrs.LRStruct
Changes the head node (i.e.
setRest(LRStruct<T>, LRStruct<T>) - Method in class lrs.ANode
Sets a new tail for the referencing LRStruct.
setRest(LRStruct<T>, LRStruct<T>) - Method in class lrs.EmptyNode
Throws java.util.NoSuchElementException.
setRest(LRStruct<T>) - Method in class lrs.LRStruct
Sets a new tail for this LRStruct.
post condition: getRest() now returns tail.
setRest(LRStruct<T>, LRStruct<T>) - Method in class lrs.NENode
 

T

toString(LRStruct<T>) - Method in class lrs.ANode
 
toString() - Method in class lrs.LRStruct
Returns "()" if empty, otherwise returns the contents of this LRStruct enclosed in parentheses.
ToStringAlgo - Variable in class lrs.ANode
Uses anonymous visitor class to compute a String representation.

_

_dat - Variable in class lrs.NENode
 
_head - Variable in class lrs.LRStruct
The state of of this LRStruct.
_order - Variable in class lrs.visitor.InsertInOrder
 
_tail - Variable in class lrs.NENode
 

A E G I L N R S T _