mondrian.olap
Class Util.GcIterator<T>

java.lang.Object
  extended by mondrian.olap.Util.GcIterator<T>
Type Parameters:
T - Element type
All Implemented Interfaces:
Iterator<T>
Enclosing class:
Util

public static class Util.GcIterator<T>
extends Object
implements Iterator<T>

Garbage-collecting iterator. Iterates over a collection of references, and if any of the references has been garbage-collected, removes it from the collection.


Constructor Summary
Util.GcIterator(Iterator<? extends Reference<T>> iterator)
           
 
Method Summary
 boolean hasNext()
           
 T next()
           
static
<T2> Iterable<T2>
over(Iterable<? extends Reference<T2>> referenceIterable)
          Creates an iterator over a collection of references.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util.GcIterator

public Util.GcIterator(Iterator<? extends Reference<T>> iterator)
Method Detail

over

public static <T2> Iterable<T2> over(Iterable<? extends Reference<T2>> referenceIterable)
Creates an iterator over a collection of references.

Type Parameters:
T2 - element type
Parameters:
referenceIterable - Collection of references
Returns:
iterable over collection

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<T>

next

public T next()
Specified by:
next in interface Iterator<T>

remove

public void remove()
Specified by:
remove in interface Iterator<T>

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads