org.codehaus.groovy.util
Class ManagedLinkedList<T>
java.lang.Object
org.codehaus.groovy.util.ManagedLinkedList<T>
public class ManagedLinkedList<T>
- extends java.lang.Object
This class provides a very simple linked list of memory managed elements.
This class does not support concurrent modifications nor will it check
for them. This class is also not thread safe.
- Since:
- 1.6
- Author:
- Jochen Theodorou
Method Summary |
void |
add(T value)
adds a value to the list |
boolean |
isEmpty()
returns if the list is empty |
java.util.Iterator<T> |
iterator()
returns an iterator, which allows the removal of elements. |
T[] |
toArray(T[] tArray)
this will return an array of non null elements of this list |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tail
private ManagedLinkedList.Element<T> tail
head
private ManagedLinkedList.Element<T> head
bundle
private ReferenceBundle bundle
ManagedLinkedList
public ManagedLinkedList(ReferenceBundle bundle)
add
public void add(T value)
- adds a value to the list
- Parameters:
value
- the value
iterator
public java.util.Iterator<T> iterator()
- returns an iterator, which allows the removal of elements.
The next() method of the iterator may return null values. This
is especially the case if the value was removed
- Returns:
- the Iterator
toArray
public T[] toArray(T[] tArray)
- this will return an array of non null elements of this list
- Returns:
- the array
isEmpty
public boolean isEmpty()
- returns if the list is empty
- Returns:
- true if the list is empty
Copyright © ${year} The Codehaus. All Rights Reserved.