de.caff.generics

## Class FilteringIteratorWrapper<T>

- java.lang.Object
- - de.caff.generics.FilteringIteratorWrapper<T>

- All Implemented Interfaces:
    java.util.Iterator<T>

      public class FilteringIteratorWrapper<T>
      extends java.lang.Object
      implements java.util.Iterator<T>

  A wrapper for a standard iterator which only iterates over selected elements.
  Since:
    September 30, 2021
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilteringIteratorWrapper(java.util.Iterator<T> iterator, java.util.function.Predicate<? super T> filter)` Create a filtering iterator.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `T` | `next()`

    - ### 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, remove`

- - ### Constructor Detail

    - #### FilteringIteratorWrapper

          public FilteringIteratorWrapper(@NotNull
                                          java.util.Iterator<T> iterator,
                                          @NotNull
                                          java.util.function.Predicate<? super T> filter)

      Create a filtering iterator.
      Parameters:
        `iterator` - basic iterator
        `filter` - filter which selects the elements which are returned by this iterator

  - ### Method Detail

    - #### 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>`