de.caff.generics.handler

## Class FindAllIndexesHandler<T>

- java.lang.Object
- - de.caff.generics.handler.FindAllIndexesHandler<T>

- All Implemented Interfaces:
    LoopHandler, LoopItemHandler<T>

      public class FindAllIndexesHandler<T>
      extends java.lang.Object
      implements LoopItemHandler<T>

  Handler which finds the index of an item in a loop.
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FindAllIndexesHandler(T object)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterFinish()` Called after the loop has finished.
    `void` | `beforeStart()` Called before the loop is started.
    `java.util.List<OrderedPair<java.lang.Integer,T>>` | `getFoundItems()` Get the found indexes and items.
    `T` | `getSearchObject()` Get the looked up object.
    `boolean` | `handle(T item)` Handle an item.

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

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

- - ### Constructor Detail

    - #### FindAllIndexesHandler

          public FindAllIndexesHandler(@Nullable
                                       T object)

      Constructor. This searches from the beginning.
      Parameters:
        `object` - object to look for

  - ### Method Detail

    - #### handle

          public boolean handle(T item)

      Handle an item.
      Specified by:
        `handle` in interface `LoopItemHandler<T>`
      Parameters:
        `item` - item to handle
      Returns:
        `true` go on with loop
        `false` break loop

    - #### beforeStart

          public void beforeStart()

      Called before the loop is started.
      Specified by:
        `beforeStart` in interface `LoopHandler`

    - #### afterFinish

          public void afterFinish()

      Called after the loop has finished.
      Specified by:
        `afterFinish` in interface `LoopHandler`

    - #### getFoundItems

          public java.util.List<OrderedPair<java.lang.Integer,T>> getFoundItems()

      Get the found indexes and items.
      Returns:
        list of pairs of found index and item at that index

    - #### getSearchObject

          @Nullable
          public T getSearchObject()

      Get the looked up object.
      Returns:
        first found index or `null`