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