org.apache.activemq.apollo.util.list
Class LinkedNode<T extends LinkedNode<T>>
java.lang.Object
org.apache.activemq.apollo.util.list.LinkedNode<T>
- Direct Known Subclasses:
- Sequence
public class LinkedNode<T extends LinkedNode<T>>
- extends java.lang.Object
Provides a base class for you to extend when you want object to maintain a
doubly linked list to other objects without using a collection class.
- Author:
- chirino
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
list
protected LinkedNodeList<T extends LinkedNode<T>> list
next
protected T extends LinkedNode<T> next
prev
protected T extends LinkedNode<T> prev
LinkedNode
public LinkedNode()
getHeadNode
public final T getHeadNode()
getTailNode
public final T getTailNode()
getNext
public final T getNext()
getPrevious
public final T getPrevious()
getNextCircular
public final T getNextCircular()
getPreviousCircular
public final T getPreviousCircular()
isHeadNode
public final boolean isHeadNode()
isTailNode
public final boolean isTailNode()
linkAfter
public final void linkAfter(T node)
- Parameters:
node
- the node to link after this node.
linkAfter
public final void linkAfter(LinkedNodeList<T> rightList)
- Parameters:
rightList
- the node to link after this node.
linkBefore
public final void linkBefore(T node)
- Parameters:
node
- the node to link after this node.
linkBefore
public final void linkBefore(LinkedNodeList<T> leftList)
- Parameters:
leftList
- the node to link after this node.
linkToTail
public final void linkToTail(LinkedNodeList<T> target)
linkToHead
public final void linkToHead(LinkedNodeList<T> target)
unlink
public final boolean unlink()
- Removes this node out of the linked list it is chained in.
splitAfter
public final LinkedNodeList<T> splitAfter()
- Splits the list into 2 lists. This node becomes the tail of this list.
Then 2nd list is returned.
- Returns:
- An empty list if this is a tail node.
splitBefore
public final LinkedNodeList<T> splitBefore()
- Splits the list into 2 lists. This node becomes the head of this list.
Then 2nd list is returned.
- Returns:
- An empty list if this is a head node.
isLinked
public final boolean isLinked()
getList
public final LinkedNodeList<T> getList()
Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.