lrs
Class NENode

java.lang.Object
  extended by lrs.ANode
      extended by lrs.NENode

 class NENode
extends ANode

Represents the non-empty state of a LStruct.

Since:
10/09/01
Author:
Dung X. Nguyen Copyright 2001 - All rights reserved.

Field Summary
private  java.lang.Object _dat
          The first data element of this LRStruct.
private  LRStruct _tail
          The rest of this LRStruct.
 
Constructor Summary
NENode(java.lang.Object dat, LRStruct tail)
          Initializes this NENode to contain dat and a given tail list.
 
Method Summary
(package private)  java.lang.Object execute(IAlgo algo, java.lang.Object input, LRStruct owner)
          Calls the visitor's non-empty case.
(package private)  java.lang.Object getFirst(LRStruct owner)
          Returns the first data object of the referencing LRStruct.
(package private)  LRStruct getRest(LRStruct owner)
          Returns the rest LRStruct of the referencing LRStruct.
(package private)  LRStruct insertFront(java.lang.Object dat, LRStruct owner)
          Inserts a data object at the front of the LRStruct owner.
(package private)  java.lang.Object removeFront(LRStruct owner)
          Removes and returns the first data object for the referencing LRStruct.
(package private)  LRStruct setFirst(java.lang.Object first, LRStruct owner)
          Sets a new first data object for the referencing LRStruct.
(package private)  LRStruct setRest(LRStruct tail, LRStruct owner)
          Sets a new rest for the referencing LRStruct.
 
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

_dat

private java.lang.Object _dat
The first data element of this LRStruct.


_tail

private LRStruct _tail
The rest of this LRStruct.

Constructor Detail

NENode

NENode(java.lang.Object dat,
       LRStruct tail)
Initializes this NENode to contain dat and a given tail list.

Parameters:
dat - the data object to be stored in this NENode.
tail - the LRStruct tail of this NENode.
Method Detail

getRest

LRStruct getRest(LRStruct owner)
Description copied from class: ANode
Returns the rest LRStruct of the referencing LRStruct.

Specified by:
getRest in class ANode
Parameters:
owner - the LRStruct referencing this ANode.
Returns:
the rest LRStruct of owner.

getFirst

java.lang.Object getFirst(LRStruct owner)
Description copied from class: ANode
Returns the first data object of the referencing LRStruct.

Specified by:
getFirst in class ANode
Parameters:
owner - the LRStruct referencing this ANode.
Returns:
the rest LRStruct of owner.

setRest

LRStruct setRest(LRStruct tail,
                 LRStruct owner)
Description copied from class: ANode
Sets a new rest for the referencing LRStruct.

Specified by:
setRest in class ANode
Parameters:
tail - the new rest for the owner LRStruct.
owner - the LRS referencing this ANode.
Returns:
LRStruct owner

setFirst

LRStruct setFirst(java.lang.Object first,
                  LRStruct owner)
Description copied from class: ANode
Sets a new first data object for the referencing LRStruct.

Specified by:
setFirst in class ANode
Parameters:
first - the new data object for this ANode.
owner - the LRS referencing this ANode.
Returns:
LRStruct owner

insertFront

LRStruct insertFront(java.lang.Object dat,
                     LRStruct owner)
Inserts a data object at the front of the LRStruct owner.

Specified by:
insertFront in class ANode
Parameters:
dat - the object to be inserted at the front.
owner - the LRS referencing this NENode.
Returns:
LRStruct owner

removeFront

java.lang.Object removeFront(LRStruct owner)
Description copied from class: ANode
Removes and returns the first data object for the referencing LRStruct.

Specified by:
removeFront in class ANode
Parameters:
owner - the LRS referencing this ANode.
Returns:
the front data of the LRStruct owner.

execute

java.lang.Object execute(IAlgo algo,
                         java.lang.Object input,
                         LRStruct owner)
Calls the visitor's non-empty case.

Specified by:
execute in class ANode
Parameters:
algo - the visitor algorithm to be executed.
input - the input needed by the algorithm.
owner - the LRStruct referencing this ANode.