net.sf.mmm.util.collection.api
Interface LinkedNode<V,NODE extends LinkedNode<V,NODE>>

Type Parameters:
V - is the generic type of the value of this node.
NODE - is the generic type of the node itself.
All Known Subinterfaces:
DoubleLinkedNode<V,NODE>
All Known Implementing Classes:
AbstractLinkedNode, BasicDoubleLinkedNode, BasicLinkedNode

public interface LinkedNode<V,NODE extends LinkedNode<V,NODE>>

This is the interface for a node of a linked list.
ATTENTION:
According to the generic-type-system of Java this interface can not be used as a proper API until the generic <NODE> is finally bound. Please use BasicLinkedNode instead.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Method Summary
 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.
 List<V> toList()
          This method converts the list represented by this node to a regular List.
 

Method Detail

getNext

NODE getNext()
This method gets the next node of the linked list.

Returns:
the next node or null if this is the last node (tail).

getValue

V getValue()
This method gets the actual value of this node.

Returns:
the value, may be null.

isLinked

boolean isLinked()
This method determines if this node is linked. A node is linked if it has a next node.

Returns:
true if linked, false otherwise.

addToList

void addToList(List<V> list)
This method appends the values of the list represented by this node to the given list.
Call this method on the head-node with an empty List to convert a LinkedNode-list to a regular List.

Parameters:
list - is where to append the values.

toList

List<V> toList()
This method converts the list represented by this node to a regular List.

Returns:
the List of all values of the list represented by this node.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.