scranton
Class Linear1Ind

java.lang.Object
  extended byscranton.Linear1
      extended byscranton.Linear1Ind
Direct Known Subclasses:
RecursiveListViaLinear1Ind, StackViaLinear1Ind

public class Linear1Ind
extends Linear1

Extends the Linear1 class with insert and remove methods that assume one level of indirection that is normally associated with one way linear recursive structures that apply 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 that support indirect referencing are indInsert and indRemove.


Field Summary
 
Fields inherited from class scranton.Linear1
data, link
 
Constructor Summary
Linear1Ind()
          Constructs a "null" Liner1Ind object.
Linear1Ind(java.lang.Object data)
          Constructs a non-empty Linear1Ind object with no recursive reference (a null reference).
Linear1Ind(java.lang.Object data, Linear1Ind link)
          Constructs a non empty Linear1Ind object with a given recursive reference to another (possibly null) object.
 
Method Summary
 void indInsert(Linear1Ind newObj)
          Relinks the recursively referenced Linear1Ind structure by inserting a new Linear1Ind 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".
 Linear1Ind 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 Linear1Ind object at one level of indirection from this.
 java.lang.Object indView()
          References the object in the Linear1Ind object at one level of indirection from this.
 java.lang.String toString()
          Returns a string composed of a tab delimited sequence of the data.toString()s of the objects in the recursive Linear1Ind structure starting at one level of indirection from this.
 
Methods inherited from class scranton.Linear1
factory, getData, getLink, setData, setLink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Linear1Ind

public Linear1Ind()
Constructs a "null" Liner1Ind object.

See Also:
Object.Object()

Linear1Ind

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

Parameters:
data -

Linear1Ind

public Linear1Ind(java.lang.Object data,
                  Linear1Ind link)
Constructs a non empty Linear1Ind object with a given recursive reference to another (possibly null) object.

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

indView

public java.lang.Object indView()
References the object in the Linear1Ind 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 references Linear1Ind object.

indReplace

public void indReplace(java.lang.Object o)
Replaces the contents of the Linear1Ind 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(Linear1Ind newObj)
Relinks the recursively referenced Linear1Ind structure by inserting a new Linear1Ind 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:
newObj - The Linear1Ind object that is inserted (relinked) at one level of indirection.

indRemove

public Linear1Ind 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 Linear1Ind object at one level of indirection.

toString

public java.lang.String toString()
Returns a string composed of a tab delimited sequence of the data.toString()s of the objects in the recursive Linear1Ind structure starting at one level of indirection from this.

Overrides:
toString in class Linear1
Returns:
String Returns a tab delimited string of the objects in the recursive Linear1 structure.