|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.DoublyLinkedListElement<ELTTYPE>
public class DoublyLinkedListElement<ELTTYPE>
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
Constructor Summary | |
---|---|
DoublyLinkedListElement(ELTTYPE v)
Construct a doubly linked list element containing a value. |
|
DoublyLinkedListElement(ELTTYPE v,
DoublyLinkedListElement<ELTTYPE> next,
DoublyLinkedListElement<ELTTYPE> 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. |
DoublyLinkedListElement<ELTTYPE> |
next()
Access the reference to the next value. |
DoublyLinkedListElement<ELTTYPE> |
previous()
Get a reference to the previous element of the list. |
void |
setNext(DoublyLinkedListElement<ELTTYPE> next)
Set reference to the next element. |
void |
setPrevious(DoublyLinkedListElement<ELTTYPE> previous)
Set the reference to the previous element. |
void |
setValue(ELTTYPE value)
Set the value of the element. |
java.lang.String |
toString()
Construct a string representation of the element. |
ELTTYPE |
value()
Get value stored within the element. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DoublyLinkedListElement(ELTTYPE v, DoublyLinkedListElement<ELTTYPE> next, DoublyLinkedListElement<ELTTYPE> previous)
v
- The value associated with the element.next
- The reference to the next element.previous
- The reference to the previous element.public DoublyLinkedListElement(ELTTYPE v)
v
- The value referenced by this element.Method Detail |
---|
public DoublyLinkedListElement<ELTTYPE> next()
public DoublyLinkedListElement<ELTTYPE> previous()
public ELTTYPE value()
public void setNext(DoublyLinkedListElement<ELTTYPE> next)
next
- The reference to the new next element.public void setPrevious(DoublyLinkedListElement<ELTTYPE> previous)
previous
- The new previous element.public void setValue(ELTTYPE 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 |