Package mondrian.olap

Class Util.GcIterator<T>

  • Type Parameters:
    T - Element type
    All Implemented Interfaces:
    java.util.Iterator<T>
    Enclosing class:
    Util

    public static class Util.GcIterator<T>
    extends java.lang.Object
    implements java.util.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

      Constructors 
      Constructor Description
      GcIterator​(java.util.Iterator<? extends java.lang.ref.Reference<T>> iterator)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      T next()  
      static <T2> java.lang.Iterable<T2> over​(java.lang.Iterable<? extends java.lang.ref.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
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • GcIterator

        public GcIterator​(java.util.Iterator<? extends java.lang.ref.Reference<T>> iterator)
    • Method Detail

      • over

        public static <T2> java.lang.Iterable<T2> over​(java.lang.Iterable<? extends java.lang.ref.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 java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • remove

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