Class DistinctIteration<E,​X extends java.lang.Exception>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, CloseableIteration<E,​X>, Iteration<E,​X>
    Direct Known Subclasses:
    LimitedSizeDistinctIteration

    @Deprecated(since="4.1.0")
    public class DistinctIteration<E,​X extends java.lang.Exception>
    extends FilterIteration<E,​X>
    Deprecated.
    An Iteration that filters any duplicate elements from an underlying iterator.
    • Field Detail

      • excludeSet

        private final java.util.Set<E> excludeSet
        Deprecated.
        The elements that have already been returned.
    • Constructor Detail

      • DistinctIteration

        public DistinctIteration​(Iteration<? extends E,​? extends X> iter)
        Deprecated.
        Creates a new DistinctIterator.
        Parameters:
        iter - The underlying iterator.
      • DistinctIteration

        public DistinctIteration​(Iteration<? extends E,​? extends X> iter,
                                 java.util.function.Supplier<java.util.Set<E>> setMaker)
        Deprecated.
    • Method Detail

      • accept

        protected boolean accept​(E object)
                          throws X extends java.lang.Exception
        Deprecated.
        Returns true if the specified object hasn't been seen before.
        Specified by:
        accept in class FilterIteration<E,​X extends java.lang.Exception>
        Parameters:
        object - The object to be tested.
        Returns:
        true if the object should be returned, false otherwise.
        Throws:
        X
        X extends java.lang.Exception
      • inExcludeSet

        private boolean inExcludeSet​(E object)
        Deprecated.
        Parameters:
        object -
        Returns:
        true if the object is in the excludeSet
      • add

        protected boolean add​(E object)
                       throws X extends java.lang.Exception
        Deprecated.
        Parameters:
        object - to put into the set
        Throws:
        X extends java.lang.Exception
      • makeSet

        protected java.util.Set<E> makeSet()
        Deprecated.