Top Description Inners Fields Constructors Methods
org.codehaus.groovy.util

public Class ManagedLinkedList<T>

extends Object
Class Inheritance
Annotations
@Deprecated
Imports
java.util.ArrayList, .Iterator, .List

Deprecated

replaced by ManagedConcurrentLinkedQueue

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private final ReferenceBundle
private ManagedLinkedList<T>.Element<T>
private ManagedLinkedList<T>.Element<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(T
the value
value
)

adds a value to the list

public boolean

Returns:

true if the list is empty
isEmpty
()

returns if the list is empty

public Iterator<T>

Returns:

the Iterator
iterator
()

returns an iterator, which allows the removal of elements.

public T[]

Returns:

the array
toArray
(T[]
the source array
tArray
)

Returns an array of non null elements from the source array.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bundleback to summary
private final ReferenceBundle bundle
tailback to summary
private ManagedLinkedList<T>.Element<T> tail

Constructor Detail

ManagedLinkedListback to summary
public ManagedLinkedList(ReferenceBundle bundle)

Method Detail

addback to summary
public void add(T value)

adds a value to the list

Parameters
value:T

the value

isEmptyback to summary
public boolean isEmpty()

returns if the list is empty

Returns:boolean

true if the list is empty

iteratorback to summary
public 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:Iterator<T>

the Iterator

toArrayback to summary
public T[] toArray(T[] tArray)

Returns an array of non null elements from the source array.

Parameters
tArray:T[]

the source array

Returns:T[]

the array

org.codehaus.groovy.util back to summary

private final Class ManagedLinkedList.Element<V>

extends ManagedReference<V>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv ManagedLinkedList.Element<V>
pack-priv ManagedLinkedList.Element<V>

Constructor Summary

AccessConstructor and Description
public
Element(ReferenceBundle bundle, V value)

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from org.codehaus.groovy.util.ManagedReference:
clearget

Field Detail

nextback to summary
pack-priv ManagedLinkedList.Element<V> next
previousback to summary
pack-priv ManagedLinkedList.Element<V> previous

Constructor Detail

Elementback to summary
public Element(ReferenceBundle bundle, V value)

Method Detail

finalizeReferenceback to summary
public void finalizeReference()

Overrides org.codehaus.groovy.util.ManagedReference.finalizeReference.

Implements org.codehaus.groovy.util.Finalizable.finalizeReference.

Annotations
@Override
org.codehaus.groovy.util back to summary

private final Class ManagedLinkedList.Iter

extends Object
implements Iterator<T>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private ManagedLinkedList<T>.Element<T>
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
Iter()

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public T
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentback to summary
private ManagedLinkedList<T>.Element<T> current
currentHandledback to summary
private boolean currentHandled

Constructor Detail

Iterback to summary
pack-priv Iter()

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

nextback to summary
public T next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:T

the next element in the iteration

removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.