de.caff.generics

## Class Loop.Item<T>

- java.lang.Object
- - de.caff.generics.BasicLoop.Item<Loop.Item<T>>
  - - de.caff.generics.Loop.Item<T>

- Type Parameters:
    `T` - value type
  Enclosing class:
    Loop<T>

      public static class Loop.Item<T>
      extends BasicLoop.Item<Loop.Item<T>>

  Generic loop item.

- - ### Field Summary

    - ### Fields inherited from class de.caff.generics.BasicLoop.Item

      `loop, next, previous`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Item(T value, BasicLoop<Loop.Item<T>> loop, Loop.Item<T> previous, Loop.Item<T> next)` Create an item.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Loop.Item<T>` | `findNextValue(java.util.function.Predicate<? super T> condition)` Find the next item for which its value fulfills a given condition.
    `Loop.Item<T>` | `findPreviousValue(java.util.function.Predicate<? super T> condition)` Find the previous item for which its value fulfills a given condition.
    `T` | `getValue()` Get the value.
    `T` | `setValue(T newValue)` Exchange the value
    `java.lang.String` | `toString()`

    - ### Methods inherited from class de.caff.generics.BasicLoop.Item

      `advanced, exchangeWith, findNext, findPrevious, getLoop, getNext, getPrevious, insertAfter, insertBefore, isValid, iteratorTo, minStepsTo, remove, stepsTo, swapPlaces`

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

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

- - ### Constructor Detail

    - #### Item

          protected Item(@NotNull
                         T value,
                         @NotNull
                         BasicLoop<Loop.Item<T>> loop,
                         @Nullable
                         Loop.Item<T> previous,
                         @Nullable
                         Loop.Item<T> next)

      Create an item.
      Parameters:
        `value` - value contained in this item
        `loop` - loop to which this item will belong
        `previous` - previous item (or `null` if this is the first item)
        `next` - next item (or `null` if this is the first item)

  - ### Method Detail

    - #### getValue

          @NotNull
          public T getValue()

      Get the value.
      Returns:
        value

    - #### setValue

          @NotNull
          public T setValue(@NotNull
                                     T newValue)

      Exchange the value
      Parameters:
        `newValue` - new value to set for this item
      Returns:
        old value of this item

    - #### findNextValue

          @Nullable
          public Loop.Item<T> findNextValue(@NotNull
                                                      java.util.function.Predicate<? super T> condition)

      Find the next item for which its value fulfills a given condition.
      Parameters:
        `condition` - value condition
      Returns:
        next matching item, or `null` if no item matches

    - #### findPreviousValue

          @Nullable
          public Loop.Item<T> findPreviousValue(@NotNull
                                                          java.util.function.Predicate<? super T> condition)

      Find the previous item for which its value fulfills a given condition.
      Parameters:
        `condition` - value condition
      Returns:
        next matching item, or `null` if no item matches

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`