V - is the generic type of the value of this node.NODE - is the generic type of the node itself.public abstract class AbstractLinkedNode<V,NODE extends AbstractLinkedNode<V,NODE>> extends Object implements LinkedNode<V,NODE>
LinkedNode interface.| Constructor and Description |
|---|
AbstractLinkedNode()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToList(List<V> list)
This method appends the
values of the list represented by this node to the given list. |
NODE |
getNext()
This method gets the next node of the linked list.
|
V |
getValue()
This method gets the actual value of this node.
|
boolean |
isLinked()
This method determines if this node is linked.
|
void |
setNext(NODE next)
This method sets the
next node. |
void |
setValue(V value)
This method sets the
value. |
List<V> |
toList()
This method converts the list represented by this node to a regular
List. |
String |
toString() |
private V value
private NODE extends AbstractLinkedNode<V,NODE> next
public NODE getNext()
LinkedNodegetNext in interface LinkedNode<V,NODE extends AbstractLinkedNode<V,NODE>>node or null if this is the last node (tail).public void setNext(NODE next)
next node.next - is the next to set. May be null to indicate that this is the last node of the list.public V getValue()
LinkedNodegetValue in interface LinkedNode<V,NODE extends AbstractLinkedNode<V,NODE>>null.public void setValue(V value)
value.value - is the value to set. May be null.public boolean isLinked()
LinkedNodenext node.isLinked in interface LinkedNode<V,NODE extends AbstractLinkedNode<V,NODE>>true if linked, false otherwise.public void addToList(List<V> list)
LinkedNodevalues of the list represented by this node to the given list.
List to convert a LinkedNode-list to a regular
List.addToList in interface LinkedNode<V,NODE extends AbstractLinkedNode<V,NODE>>list - is where to append the values.public List<V> toList()
LinkedNodeList.toList in interface LinkedNode<V,NODE extends AbstractLinkedNode<V,NODE>>List of all values of the list represented by this node.Copyright © 2001–2016 mmm-Team. All rights reserved.