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

Constructor Index

 o DoublyLinkedListElement(Object)
Construct a doubly linked list element containing a value.
 o DoublyLinkedListElement(Object, DoublyLinkedListElement, DoublyLinkedListElement)
Construct a doubly linked list element.

Method Index

 o equals(Object)
Determine if this element equal to another.
 o hashCode()
Generate hash code associated with the element.
 o next()
Access the reference to the next value.
 o previous()
Get a reference to the previous element of the list.
 o setNext(DoublyLinkedListElement)
Set reference to the next element.
 o setPrevious(DoublyLinkedListElement)
Set the reference to the previous element.
 o setValue(Object)
Set the value of the element.
 o toString()
Construct a string representation of the element.
 o value()
Get value stored within the element.

Constructors

 o 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.
 o 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.

Methods

 o 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.
 o 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.
 o value
public Object value()
Get value stored within the element.

Postcondition:
returns value stored here

Returns:
The reference to the value stored.
 o 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.
 o 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.
 o 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.
 o 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
 o 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
 o 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