de.caff.generics

## Class TypesImpFilter

- java.lang.Object
- - de.caff.generics.TypesImpFilter

-     final class TypesImpFilter
      extends java.lang.Object

  Partial class used by Types, defining the filter algorithms.
  Author:
    Rammi

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <C extends java.util.Collection<? super T>,T> C` | `filterImpl(C target, java.util.Enumeration<T> enumeration, java.util.function.Predicate<? super T> checker)` Filter the elements of an iterator into a collection.
    `static <C extends java.util.Collection<? super T>,T> C` | `filterImpl(C target, java.util.Iterator<T> iterator, java.util.function.Predicate<? super T> checker)` Filter the elements of an iterator into a collection.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### filterImpl

          @NotNull
          public static <C extends java.util.Collection<? super T>,T> C filterImpl(@NotNull
                                                                                            C target,
                                                                                            @NotNull
                                                                                            java.util.Iterator<T> iterator,
                                                                                            @NotNull
                                                                                            java.util.function.Predicate<? super T> checker)

      Filter the elements of an iterator into a collection.

      This will add all filtered elements to the target collection.

      Note that iterator is not allowed to be an iterator of the target collection, otherwise you'll get either a `ConcurrentModificationException`, or another exception because you are running into an endless loop.

      Type Parameters:
        `C` - collection type
        `T` - filtered type
      Parameters:
        `target` - collection where the mapped elements are added
        `iterator` - iterator providing the source elements
        `checker` - value checker to decide which elements are kept
      Returns:
        reference to target, allowing to create it directly in the call

    - #### filterImpl

          @NotNull
          public static <C extends java.util.Collection<? super T>,T> C filterImpl(@NotNull
                                                                                            C target,
                                                                                            @NotNull
                                                                                            java.util.Enumeration<T> enumeration,
                                                                                            @NotNull
                                                                                            java.util.function.Predicate<? super T> checker)

      Filter the elements of an iterator into a collection.

      This will add all filtered elements to the target collection.

      Note that iterator is not allowed to be an iterator of the target collection, otherwise you'll get either a `ConcurrentModificationException`, or another exception because you are running into an endless loop.

      Type Parameters:
        `C` - collection type
        `T` - filtered type
      Parameters:
        `target` - collection where the mapped elements are added
        `enumeration` - enumeration providing the source elements
        `checker` - value checker to decide which elements are kept
      Returns:
        reference to target, allowing to create it directly in the call