|
© 1998-2002 McGraw-Hill | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--structure.DoublyLinkedListElement
A class supporting a doubly linked list element. Each element contains a value and maintains references to the previous and next nodes in the list.
DoublyLinkedList| Field Summary | |
protected Object |
data
The actual value stored within element; provided by user. |
protected DoublyLinkedListElement |
nextElement
The reference of element following. |
protected DoublyLinkedListElement |
previousElement
The reference to element preceding. |
| Constructor Summary | |
DoublyLinkedListElement(Object v)
Construct a doubly linked list element containing a value. |
|
DoublyLinkedListElement(Object v,
DoublyLinkedListElement next,
DoublyLinkedListElement previous)
Construct a doubly linked list element. |
|
| Method Summary | |
boolean |
equals(Object other)
Determine if this element equal to another. |
int |
hashCode()
Generate hash code associated with the element. |
DoublyLinkedListElement |
next()
Access the reference to the next value. |
DoublyLinkedListElement |
previous()
Get a reference to the previous element of the list. |
void |
setNext(DoublyLinkedListElement next)
Set reference to the next element. |
void |
setPrevious(DoublyLinkedListElement previous)
Set the reference to the previous element. |
void |
setValue(Object value)
Set the value of the element. |
String |
toString()
Construct a string representation of the element. |
Object |
value()
Get value stored within the element. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Object data
protected DoublyLinkedListElement nextElement
protected DoublyLinkedListElement previousElement
| Constructor Detail |
public DoublyLinkedListElement(Object v,
DoublyLinkedListElement next,
DoublyLinkedListElement previous)
v - The value associated with the element.next - The reference to the next element.previous - The reference to the previous element.public DoublyLinkedListElement(Object v)
v - The value referenced by this element.| Method Detail |
public DoublyLinkedListElement next()
public DoublyLinkedListElement previous()
public Object value()
public void setNext(DoublyLinkedListElement next)
next - The reference to the new next element.public void setPrevious(DoublyLinkedListElement previous)
previous - The new previous element.public void setValue(Object value)
value - The new value associated with the element.public boolean equals(Object other)
equals in class Objectother - The other doubly linked list element.public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
© 1998-2002 McGraw-Hill | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||