Top Description Methods
org.fxmisc.richtext.model

public Interface SegmentOps<SEG, S>

Additional top-level classes in compilation unit: EitherSegmentOps, EitherStyledSegmentOps.

Known Direct Subinterfaces
org.fxmisc.richtext.model.TextOps
Known Direct Implementers
org.fxmisc.richtext.model.EitherSegmentOps, org.fxmisc.richtext.model.EitherStyledSegmentOps, org.fxmisc.richtext.model.SegmentOpsBase
Type Parameters
<SEG>
The segment type
<S>
The style type for the segment
Imports
java.util.Optional, java.util.function.BiFunction, org.reactfx.util.Either

Defines the operations which are supported on a specific segment type.

Method Summary

Modifier and TypeMethod and Description
public char
charAt(SEG seg, int index)

public SEG
createEmptySeg()

Creates an empty segment.

public static <LSeg, RSeg, Style> SegmentOps<Either<LSeg, RSeg>, Style>
either(SegmentOps<LSeg, Style> lOps, SegmentOps<RSeg, Style> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is lOps' segment type and whose right value is rOps' segment type.

public static <LSeg, RSeg, Style> SegmentOps<Either<LSeg, RSeg>, Style>
either(SegmentOps<LSeg, Style> lOps, SegmentOps<RSeg, Style> rOps, BiFunction<Style, Style, Optional<Style>> mergeStyle)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is lOps' segment type and whose right value is rOps' segment type.

public static <LSeg, LStyle, RSeg, RStyle> SegmentOps<Either<LSeg, RSeg>, Either<LStyle, RStyle>>
eitherStyles(SegmentOps<LSeg, LStyle> lOps, SegmentOps<RSeg, RStyle> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is lOps' segment type and whose right value is rOps' segment type, and that specifies its style type to be Either whose left value is lOps' style type and whose right value is rOps' style type.

public String
getText(SEG seg)

public Optional<SEG>
joinSeg(SEG currentSeg, SEG nextSeg)

Joins two consecutive segments together into one or Optional#empty() if they cannot be joined.

public default Optional<S>
joinStyle(S currentStyle, S nextStyle)

Joins two consecutive styles together into one or Optional#empty() if they cannot be joined.

public int
length(SEG seg)

public default <R> SegmentOps<Either<SEG, R>, S>
or(SegmentOps<R, S> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is this segment type and whose right value is rOps' segment type.

public default <RSeg, RStyle> SegmentOps<Either<SEG, RSeg>, Either<S, RStyle>>
orStyled(SegmentOps<RSeg, RStyle> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is this segment type and whose right value is rOps' segment type, and that specifies its style type to be Either whose left value is this style type and whose right value is rOps' style type.

public static <S> TextOps<String, S>
styledTextOps()

Creates a TextOps specified for a String segment that never merges consecutive styles

public static <S> TextOps<String, S>
styledTextOps(BiFunction<S, S, Optional<S>> mergeStyle)

Creates a TextOps specified for a String

public SEG
subSequence(SEG seg, int start, int end)

public SEG
subSequence(SEG seg, int start)

Method Detail

charAtback to summary
public char charAt(SEG seg, int index)
createEmptySegback to summary
public SEG createEmptySeg()

Creates an empty segment. This method should return the same object for better performance and memory usage.

eitherback to summary
public static <LSeg, RSeg, Style> SegmentOps<Either<LSeg, RSeg>, Style> either(SegmentOps<LSeg, Style> lOps, SegmentOps<RSeg, Style> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is lOps' segment type and whose right value is rOps' segment type.

Note

consecutive styles will not be merged.

eitherback to summary
public static <LSeg, RSeg, Style> SegmentOps<Either<LSeg, RSeg>, Style> either(SegmentOps<LSeg, Style> lOps, SegmentOps<RSeg, Style> rOps, BiFunction<Style, Style, Optional<Style>> mergeStyle)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is lOps' segment type and whose right value is rOps' segment type.

eitherStylesback to summary
public static <LSeg, LStyle, RSeg, RStyle> SegmentOps<Either<LSeg, RSeg>, Either<LStyle, RStyle>> eitherStyles(SegmentOps<LSeg, LStyle> lOps, SegmentOps<RSeg, RStyle> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is lOps' segment type and whose right value is rOps' segment type, and that specifies its style type to be Either whose left value is lOps' style type and whose right value is rOps' style type.

Note

consecutive styles will not be merged.

getTextback to summary
public String getText(SEG seg)
joinSegback to summary
public Optional<SEG> joinSeg(SEG currentSeg, SEG nextSeg)

Joins two consecutive segments together into one or Optional#empty() if they cannot be joined.

joinStyleback to summary
public default Optional<S> joinStyle(S currentStyle, S nextStyle)

Joins two consecutive styles together into one or Optional#empty() if they cannot be joined. By default, returns Optional#empty().

lengthback to summary
public int length(SEG seg)
orback to summary
public default <R> SegmentOps<Either<SEG, R>, S> or(SegmentOps<R, S> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is this segment type and whose right value is rOps' segment type.

orStyledback to summary
public default <RSeg, RStyle> SegmentOps<Either<SEG, RSeg>, Either<S, RStyle>> orStyled(SegmentOps<RSeg, RStyle> rOps)

Returns a SegmentOps that specifies its segment type to be an Either whose left value is this segment type and whose right value is rOps' segment type, and that specifies its style type to be Either whose left value is this style type and whose right value is rOps' style type.

styledTextOpsback to summary
public static <S> TextOps<String, S> styledTextOps()

Creates a TextOps specified for a String segment that never merges consecutive styles

styledTextOpsback to summary
public static <S> TextOps<String, S> styledTextOps(BiFunction<S, S, Optional<S>> mergeStyle)

Creates a TextOps specified for a String

subSequenceback to summary
public SEG subSequence(SEG seg, int start, int end)
subSequenceback to summary
public SEG subSequence(SEG seg, int start)