scranton
Class Linear2Ind

java.lang.Object
  extended byscranton.Linear1
      extended byscranton.Linear2
          extended byscranton.Linear2Ind

public class Linear2Ind
extends Linear2

Extends the Linear2 class with insert and remove methods that hide a level of indirection normally associated with one way linear structures that require a null object at the beginning of the structure. A "null object" is an object that is frequently used to represent a empty structure. The extended methods to support indirect referencing are insertNext and removeNext.


Field Summary
 
Fields inherited from class scranton.Linear2
previous
 
Fields inherited from class scranton.Linear1
data, link
 
Constructor Summary
Linear2Ind()
          Constructs a "null" Liner2Ind object.
Linear2Ind(Linear2 newPrev, java.lang.Object data, Linear2 newNext)
          Constructs a non empty Linear2Ind object with a given recursive reference to another (possibly null) object.
Linear2Ind(java.lang.Object data)
          Constructs a non-empty Linear2Ind object with no recursive reference (a null reference).
 
Method Summary
 void indInsert(Linear2Ind Obj)
          Relinks the recursively referenced Linear1Ind structure by inserting a new Linear2Ind object, newObj, at one level of indirection from this, addressing the additonal level of indirection normally associated with a linear structure that begins with a "null object".
 java.lang.Object indRemove()
          Removes an object at one level of indirection from "this", addressing the removal of an object from a linear structure that begins with a "null object".
 void indReplace(java.lang.Object o)
          Replaces the contents of the Linear2Ind object at one level of indirection from this.
 java.lang.Object indView()
          References the object in the Linear2Ind object at one level of indirection from this.
 
Methods inherited from class scranton.Linear2
factory, getNext, getPrevious, setNext, setPrevious
 
Methods inherited from class scranton.Linear1
getData, getLink, setData, setLink, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Linear2Ind

public Linear2Ind()
Constructs a "null" Liner2Ind object.

See Also:
Object.Object()

Linear2Ind

public Linear2Ind(java.lang.Object data)
Constructs a non-empty Linear2Ind object with no recursive reference (a null reference).

Parameters:
data -

Linear2Ind

public Linear2Ind(Linear2 newPrev,
                  java.lang.Object data,
                  Linear2 newNext)
Constructs a non empty Linear2Ind object with a given recursive reference to another (possibly null) object.

Parameters:
newPrev - Recursive reference to the previous Linear1Ind object.
data - Reference to the assocaited object.
newNext - Recursive reference to the next Linear1Ind object.
Method Detail

indView

public java.lang.Object indView()
References the object in the Linear2Ind object at one level of indirection from this. This method addresses the additonal level of indirection normally assocaited with a linear structure that begins with a "null object"

Returns:
Object Reference to the object in the indirectly reference linear2Ind object

indReplace

public void indReplace(java.lang.Object o)
Replaces the contents of the Linear2Ind object at one level of indirection from this. This method addresses the additonal level of indirection normally assocaited with a linear structure that begins with a "null object"

Parameters:
o - The new object assocaited with the indirect reference.

indInsert

public void indInsert(Linear2Ind Obj)
Relinks the recursively referenced Linear1Ind structure by inserting a new Linear2Ind object, newObj, at one level of indirection from this, addressing the additonal level of indirection normally associated with a linear structure that begins with a "null object".

Parameters:
Obj - The Linear2Ind object that is inserted (relinked) at one level of indirection.

indRemove

public java.lang.Object indRemove()
Removes an object at one level of indirection from "this", addressing the removal of an object from a linear structure that begins with a "null object".

Returns:
Object Return the reference to the object in the Linear2Ind object at one level of indirection.