Class CharRecoveryOptimizer
java.lang.Object
com.vladsch.flexmark.util.sequence.builder.CharRecoveryOptimizer
- All Implemented Interfaces:
SegmentOptimizer
,BiFunction<CharSequence,
Object[], Object[]>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]
apply
(@NotNull CharSequence chars, Object[] parts) Optimize segment BASE parts surrounding TEXT contained in Object[] array.(package private) int
nextMatchPos
(@NotNull CharSequence base, CharSequence chars, int startIndex, int fromIndex) (package private) int
prevMatchPos
(@NotNull CharSequence base, CharSequence chars, int startIndex, int endIndex) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Field Details
-
anchor
-
prevEolPos
private int prevEolPos
-
-
Constructor Details
-
CharRecoveryOptimizer
-
-
Method Details
-
prevMatchPos
int prevMatchPos(@NotNull @NotNull CharSequence base, CharSequence chars, int startIndex, int endIndex) -
nextMatchPos
int nextMatchPos(@NotNull @NotNull CharSequence base, CharSequence chars, int startIndex, int fromIndex) -
apply
Description copied from interface:SegmentOptimizer
Optimize segment BASE parts surrounding TEXT contained in Object[] array.- Specified by:
apply
in interfaceBiFunction<CharSequence,
Object[], Object[]> - Specified by:
apply
in interfaceSegmentOptimizer
- Parameters:
chars
- base character sequenceparts
- 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
-