All Packages  Class Hierarchy  This Package  Previous  Next  Index  
Class structure.SinglyLinkedListElement
java.lang.Object
    |
    +----structure.SinglyLinkedListElement
- public class SinglyLinkedListElement
- extends Object
A class supporting a singly linked list element.  Each element
maintains a single reference to the next node in the list.
 
 SinglyLinkedListElement(Object) SinglyLinkedListElement(Object)
- Constructs a singly linked list element not associated with
any list.
 SinglyLinkedListElement(Object, SinglyLinkedListElement) SinglyLinkedListElement(Object, SinglyLinkedListElement)
- Construct a singly linked list element.
 
 next() next()
- 
- Postcondition:
-  returns reference to next value in list
 
 setNext(SinglyLinkedListElement) setNext(SinglyLinkedListElement)
- Update the next element.
 setValue(Object) setValue(Object)
- Set the value associated with this element.
 toString() toString()
- Construct a string representation of element.
 value() value()
- Fetch the value associated with this element.
 
 SinglyLinkedListElement
SinglyLinkedListElement
public SinglyLinkedListElement(Object v,
                               SinglyLinkedListElement next)
- Construct a singly linked list element.
 
 
- 
- Parameters:
- v - The value to be referenced by this element.
- next - A reference to the next value in the list.
 
 SinglyLinkedListElement
SinglyLinkedListElement
public SinglyLinkedListElement(Object v)
- Constructs a singly linked list element not associated with
any list.  next reference is set to null.
 
- Postcondition:
-  constructs a new tail of a list with value v
 
 
- 
- Parameters:
- v - The value to be inserted into the singly linked list element.
 
 
 next
next
public SinglyLinkedListElement next()
- 
- Postcondition:
-  returns reference to next value in list
 - 
 
 setNext
setNext
public void setNext(SinglyLinkedListElement next)
- Update the next element.
 
- Postcondition:
-  sets reference to new next value
 
 
- 
- Parameters:
- next - The new value of the next element reference.
 
 value
value
public Object value()
- Fetch the value associated with this element.
 
- Postcondition:
-  returns value associated with this element
 
 
- 
- Returns:
- Reference to the value stored within this element.
 
 setValue
setValue
public void setValue(Object value)
- Set the value associated with this element.
 
- Postcondition:
-  sets value associated with this element
 
 
- 
- Parameters:
- value - The new value to be associated with this element.
 
 toString
toString
public String toString()
- Construct a string representation of element.
 
- Postcondition:
-  returns string representation of element
 
 
- 
- Returns:
- The string representing element.
- Overrides:
- toString in class Object
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index