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:
02/09/05
Author:
Dung X. Nguyen Copyright 2005 - All rights reserved.

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

_tail

private LRStruct _tail
Constructor Detail

NENode

NENode(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 tail LRStruct of the referencing LRStruct.

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

getFirst

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 tail LRStruct of owner.

setRest

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

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

setFirst

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

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

insertFront

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

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

removeFront

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

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

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