org.apache.activemq.apollo.util.list
Class LinkedNodeList<T extends LinkedNode<T>>

java.lang.Object
  extended by org.apache.activemq.apollo.util.list.LinkedNodeList<T>
All Implemented Interfaces:
java.lang.Iterable<T>
Direct Known Subclasses:
SequenceSet

public class LinkedNodeList<T extends LinkedNode<T>>
extends java.lang.Object
implements java.lang.Iterable<T>

Provides a list of LinkedNode objects.

Author:
Hiram Chirino

Constructor Summary
LinkedNodeList()
           
 
Method Summary
 void addFirst(LinkedNodeList<T> list)
           
 void addFirst(T node)
           
 void addLast(LinkedNodeList<T> list)
           
 void addLast(T node)
           
 void clear()
           
 T getHead()
           
 T getTail()
           
 boolean isEmpty()
           
 java.util.Iterator<T> iterator()
           
 T reparent(LinkedNodeList<T> list)
           
 T rotate()
          Move the head to the tail and returns the new head node.
 void rotateTo(T head)
          Move the head to the tail and returns the new head node.
 int size()
           
 T[] toArray(T[] array)
          Copies the nodes of the LinkedNodeList to the specified array.
 java.util.ArrayList<T> toArrayList()
          Copies the nodes of the LinkedNodeList to an ArrayList.
 java.util.ArrayList<T> toArrayListReversed()
          Copies the nodes of the LinkedNodeList to an ArrayList in reverse order.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkedNodeList

public LinkedNodeList()
Method Detail

isEmpty

public final boolean isEmpty()

addLast

public final void addLast(T node)

addFirst

public final void addFirst(T node)

getHead

public final T getHead()

getTail

public final T getTail()

clear

public final void clear()

addLast

public final void addLast(LinkedNodeList<T> list)

addFirst

public final void addFirst(LinkedNodeList<T> list)

reparent

public final T reparent(LinkedNodeList<T> list)

rotate

public final T rotate()
Move the head to the tail and returns the new head node.

Returns:

rotateTo

public final void rotateTo(T head)
Move the head to the tail and returns the new head node.


size

public int size()

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

toArrayList

public final java.util.ArrayList<T> toArrayList()
Copies the nodes of the LinkedNodeList to an ArrayList.

Returns:

toArrayListReversed

public final java.util.ArrayList<T> toArrayListReversed()
Copies the nodes of the LinkedNodeList to an ArrayList in reverse order.

Returns:

toArray

public final T[] toArray(T[] array)
Copies the nodes of the LinkedNodeList to the specified array.

Returns:
the passed array.

iterator

public final java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T extends LinkedNode<T>>


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.