Top Methods
com.vladsch.flexmark.util.sequence.builder

public Interface SegmentOptimizer

extends BiFunction<CharSequence, Object[], Object[]>
Known Direct Implementers
com.vladsch.flexmark.util.sequence.builder.CharRecoveryOptimizer
Imports
org.jetbrains.annotations.NotNull, java.util.Arrays, java.util.function.BiFunction

Method Summary

Modifier and TypeMethod and Description
public Object[]

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
apply
(@NotNull CharSequence
base character sequence
chars
,
Object[]
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
objects
)

Redeclares java.util.function.BiFunction.apply.

Optimize segment BASE parts surrounding TEXT contained in Object[] array.

public static @NotNull Object[]

Returns:

copy of input array with extra element inserted at index
insert
(@NotNull Object[]
input array
parts
,
int
index where to insert
index
)

Insert a null at index in given parts array

Inherited from java.util.function.BiFunction:
andThen

Method Detail

applyback to summary
public Object[] apply(@NotNull CharSequence chars, Object[] objects)

Redeclares java.util.function.BiFunction.apply.

Optimize segment BASE parts surrounding TEXT contained in Object[] array.

Parameters
chars:@NotNull CharSequence

base character sequence

objects:Object[]

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[]

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

Annotations
@Override
insertback to summary
public static @NotNull Object[] insert(@NotNull Object[] parts, int index)

Insert a null at index in given parts array

Parameters
parts:@NotNull Object[]

input array

index:int

index where to insert

Returns:@NotNull Object[]

copy of input array with extra element inserted at index

Annotations
@NotNull