Interface SegmentOptimizer

All Superinterfaces:
BiFunction<CharSequence,Object[],Object[]>
All Known Implementing Classes:
CharRecoveryOptimizer

public interface SegmentOptimizer extends BiFunction<CharSequence,Object[],Object[]>
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(@NotNull CharSequence chars, Object[] objects)
    Optimize segment BASE parts surrounding TEXT contained in Object[] array.
    static @NotNull Object[]
    insert(@NotNull Object[] parts, int index)
    Insert a null at index in given parts array

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Method Details

    • apply

      Object[] apply(@NotNull @NotNull CharSequence chars, Object[] objects)
      Optimize segment BASE parts surrounding TEXT contained in Object[] array.
      Specified by:
      apply in interface BiFunction<CharSequence,Object[],Object[]>
      Parameters:
      chars - base character sequence
      objects - parts to optimize Object[0] - previous BASE Range, will be Range.NULL if no previous range Object[1] - char sequence of TEXT to optimize Object[2] - next BASE Range, will be Range.NULL if no next range
      Returns:
      Object[] containing optimized segments, non-null Range(s) are BASE segments, CharSequence(s) are TEXT segments null entry ignored, an optimal filler for unused entries Range with -ve start/end or -ve span are skipped CharSequence with 0 length skipped
    • insert

      @NotNull static @NotNull Object[] insert(@NotNull @NotNull Object[] parts, int index)
      Insert a null at index in given parts array
      Parameters:
      parts - input array
      index - index where to insert
      Returns:
      copy of input array with extra element inserted at index