Class EmptyIterator<O>

  • Type Parameters:
    O - Object
    All Implemented Interfaces:
    It<O>, Iter

    public class EmptyIterator<O>
    extends java.lang.Object
    implements It<O>
    Empty object iterator.
    Since:
    0.7.5
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static It<java.lang.Object> STATIC
      Static instance.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private EmptyIterator()
      Private constructor, use static empty() instead.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      It<O> advance()
      Moves the iterator forward to the next entry.
      static <O> It<O> empty()
      Get an empty hierarchy iterator.
      <T> It<T> filter​(java.lang.Class<? super T> clz)
      Filtered iteration.
      It<O> filter​(java.util.function.Predicate<? super O> predicate)
      Filtered iteration.
      void forEach​(java.util.function.Consumer<? super O> action)
      Process the remaining elements - this will invalidate the iterator.
      O get()
      Access the current object.
      boolean valid()
      Returns true if the iterator currently points to a valid object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface elki.utilities.datastructures.iterator.It

        collect, find
    • Field Detail

      • STATIC

        private static final It<java.lang.Object> STATIC
        Static instance.
    • Constructor Detail

      • EmptyIterator

        private EmptyIterator()
        Private constructor, use static empty() instead.
    • Method Detail

      • empty

        public static <O> It<O> empty()
        Get an empty hierarchy iterator.
        Returns:
        Empty iterator
      • valid

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • advance

        public It<O> advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface It<O>
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.
      • get

        public O get()
        Description copied from interface: It
        Access the current object.
        Specified by:
        get in interface It<O>
        Returns:
        Current object
      • filter

        public <T> It<T> filter​(java.lang.Class<? super T> clz)
        Description copied from interface: It
        Filtered iteration.

        Important: using the filtered iterator will also advance this iterator; so usually you should stop using the original iterator after calling this method.

        Specified by:
        filter in interface It<O>
        Parameters:
        clz - Class filter
        Returns:
        Filtered iterator.
      • filter

        public It<O> filter​(java.util.function.Predicate<? super O> predicate)
        Description copied from interface: It
        Filtered iteration.

        Important: using the filtered iterator will also advance this iterator; so usually you should stop using the original iterator after calling this method.

        Specified by:
        filter in interface It<O>
        Parameters:
        predicate - Test
        Returns:
        Filtered iterator.
      • forEach

        public void forEach​(java.util.function.Consumer<? super O> action)
        Description copied from interface: It
        Process the remaining elements - this will invalidate the iterator.
        Specified by:
        forEach in interface It<O>
        Parameters:
        action - Action to perform