Type Parameters:
T - the type
Direct Known Subclasses:
UnstableReplacement

public class Replacement<T> extends CachelessIndicator<T>
Replacement is an Indicator to provide the values of the given replacement Indicator instead of the values of the given replacee Indicator only for all the indices that are less than the given replacementIndex.
  • Constructor Details

    • Replacement

      protected Replacement(Indicator<T> replacee, Indicator<T> replacement, int replacementIndex)
  • Method Details

    • replacement

      public static <T> Replacement<T> replacement(Indicator<T> replacee, Indicator<T> replacement, int replacementIndex)
      Gets a Replacement.
      Parameters:
      replacee - the replacee Indicator
      replacement - the replacement Indicator
      replacementIndex - the replacement index
    • calculate

      protected T calculate(long index)
      Description copied from class: Indicator
      Performs the calculation of this Indicator at the given index.
      Specified by:
      calculate in class Indicator<T>
      Parameters:
      index - the index
      Returns:
      the result (never null)