|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.DoublyLinkedNode
public class DoublyLinkedNode
A private class implementing the element of a doubly linked list.
DoublyLinkedList
Field Summary | |
---|---|
protected java.lang.Object |
data
The actual value stored within element; provided by user. |
protected DoublyLinkedNode |
nextElement
The reference of element following. |
protected DoublyLinkedNode |
previousElement
The reference to element preceding. |
Constructor Summary | |
---|---|
DoublyLinkedNode(java.lang.Object v)
Construct a doubly linked list element containing a value. |
|
DoublyLinkedNode(java.lang.Object v,
DoublyLinkedNode next,
DoublyLinkedNode previous)
Construct a doubly linked list element. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
Determine if this element equal to another. |
int |
hashCode()
Generate hash code associated with the element. |
DoublyLinkedNode |
next()
Access the reference to the next value. |
DoublyLinkedNode |
previous()
Get a reference to the previous element of the list. |
void |
setNext(DoublyLinkedNode next)
Set reference to the next element. |
void |
setPrevious(DoublyLinkedNode previous)
Set the reference to the previous element. |
void |
setValue(java.lang.Object value)
Set the value of the element. |
java.lang.String |
toString()
Construct a string representation of the element. |
java.lang.Object |
value()
Get value stored within the element. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object data
protected DoublyLinkedNode nextElement
protected DoublyLinkedNode previousElement
Constructor Detail |
---|
public DoublyLinkedNode(java.lang.Object v, DoublyLinkedNode next, DoublyLinkedNode previous)
v
- The value associated with the element.next
- The reference to the next element.previous
- The reference to the previous element.public DoublyLinkedNode(java.lang.Object v)
v
- The value referenced by this element.Method Detail |
---|
public DoublyLinkedNode next()
public DoublyLinkedNode previous()
public java.lang.Object value()
public void setNext(DoublyLinkedNode next)
next
- The reference to the new next element.public void setPrevious(DoublyLinkedNode previous)
previous
- The new previous element.public void setValue(java.lang.Object value)
value
- The new value associated with the element.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The other doubly linked list element.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |