Class LazyDistinctIterable<T>

java.lang.Object
de.renebergelt.quiterables.iterators.LazyDistinctIterable<T>
Type Parameters:
T - Type of the elements in this Iterable
All Implemented Interfaces:
Iterable<T>

public class LazyDistinctIterable<T> extends Object implements Iterable<T>
Iterable which returns the elements of a source iterable but filters duplicates either by using the equals() method of the objects or a custom equality comparer
Author:
René Bergelt
  • Constructor Details

    • LazyDistinctIterable

      public LazyDistinctIterable(Iterable<T> _wrapped)
      Create a new lazy distinct iterable which wraps the given iterable
      Parameters:
      _wrapped - The wrapped iterable
    • LazyDistinctIterable

      public LazyDistinctIterable(Iterable<T> _wrapped, Equivalence<T> _equalityComparer)
      Create a new lazy distinct iterable which wraps the given iterable using teh given equality comparer
      Parameters:
      _wrapped - The wrapped iterable
      _equalityComparer - Comparer to decide if two elements are equal
  • Method Details