All Packages Class Hierarchy This Package Previous Next Index
Class structure.DoublyLinkedListElement
java.lang.Object
|
+----structure.DoublyLinkedListElement
- public class DoublyLinkedListElement
- extends Object
A private class implementing the element of a doubly linked list.
- See Also:
- DoublyLinkedList
DoublyLinkedListElement(Object)
- Construct a doubly linked list element containing a value.
DoublyLinkedListElement(Object, DoublyLinkedListElement, DoublyLinkedListElement)
- Construct a doubly linked list element.
equals(Object)
- Determine if this element equal to another.
hashCode()
- Generate hash code associated with the element.
next()
- Access the reference to the next value.
previous()
- Get a reference to the previous element of the list.
setNext(DoublyLinkedListElement)
- Set reference to the next element.
setPrevious(DoublyLinkedListElement)
- Set the reference to the previous element.
setValue(Object)
- Set the value of the element.
toString()
- Construct a string representation of the element.
value()
- Get value stored within the element.
DoublyLinkedListElement
public DoublyLinkedListElement(Object v,
DoublyLinkedListElement next,
DoublyLinkedListElement previous)
- Construct a doubly linked list element.
- Parameters:
- v - The value associated with the element.
- next - The reference to the next element.
- previous - The reference to the previous element.
DoublyLinkedListElement
public DoublyLinkedListElement(Object v)
- Construct a doubly linked list element containing a value.
Not part of any list (references are null).
- Postcondition:
- constructs a single element
- Parameters:
- v - The value referenced by this element.
next
public DoublyLinkedListElement next()
- Access the reference to the next value.
- Postcondition:
- returns the element that follows this
- Returns:
- Reference to the next element of the list.
previous
public DoublyLinkedListElement previous()
- Get a reference to the previous element of the list.
- Postcondition:
- returns element that precedes this
- Returns:
- Reference to the previous element.
value
public Object value()
- Get value stored within the element.
- Postcondition:
- returns value stored here
- Returns:
- The reference to the value stored.
setNext
public void setNext(DoublyLinkedListElement next)
- Set reference to the next element.
- Postcondition:
- sets value associated with this element
- Parameters:
- next - The reference to the new next element.
setPrevious
public void setPrevious(DoublyLinkedListElement previous)
- Set the reference to the previous element.
- Postcondition:
- establishes a new reference to a previous value
- Parameters:
- previous - The new previous element.
setValue
public void setValue(Object value)
- Set the value of the element.
- Postcondition:
- sets a new value for this object
- Parameters:
- value - The new value associated with the element.
equals
public boolean equals(Object other)
- Determine if this element equal to another.
- Postcondition:
- returns true if this object and other are equal
- Parameters:
- other - The other doubly linked list element.
- Returns:
- True iff the values within elements are the same.
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Generate hash code associated with the element.
- Postcondition:
- generates hash code for element
- Returns:
- The hash code associated with the value in element.
- Overrides:
- hashCode in class Object
toString
public String toString()
- Construct a string representation of the 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