SEG - The segment typeS - The style type for the segmentTextOps<SEG,S>NodeSegmentOpsBase, SegmentOpsBase, TextOpsBasepublic interface SegmentOps<SEG,S>
| Modifier and Type | Method | Description |
|---|---|---|
char |
charAt(SEG seg,
int index) |
|
SEG |
createEmptySeg() |
Creates an empty segment.
|
static <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. |
static <LSeg,RSeg,Style> |
either(SegmentOps<LSeg,Style> lOps,
SegmentOps<RSeg,Style> rOps,
java.util.function.BiFunction<Style,Style,java.util.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. |
static <LSeg,LStyle,RSeg,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. |
java.lang.String |
getText(SEG seg) |
|
java.util.Optional<SEG> |
joinSeg(SEG currentSeg,
SEG nextSeg) |
Joins two consecutive segments together into one or
Optional.empty() if they cannot be joined. |
default java.util.Optional<S> |
joinStyle(S currentStyle,
S nextStyle) |
Joins two consecutive styles together into one or
Optional.empty() if they cannot be joined. |
int |
length(SEG seg) |
|
default <R> SegmentOps<org.reactfx.util.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. |
default <RSeg,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. |
static <S> TextOps<java.lang.String,S> |
styledTextOps() |
Creates a
TextOps specified for a String segment that never merges consecutive styles |
static <S> TextOps<java.lang.String,S> |
styledTextOps(java.util.function.BiFunction<S,S,java.util.Optional<S>> mergeStyle) |
Creates a
TextOps specified for a String |
SEG |
subSequence(SEG seg,
int start) |
|
SEG |
subSequence(SEG seg,
int start,
int end) |
int length(SEG seg)
char charAt(SEG seg, int index)
java.lang.String getText(SEG seg)
java.util.Optional<SEG> joinSeg(SEG currentSeg, SEG nextSeg)
Optional.empty() if they cannot be joined.default java.util.Optional<S> joinStyle(S currentStyle, S nextStyle)
Optional.empty() if they cannot be joined. By default,
returns Optional.empty().SEG createEmptySeg()
static <S> TextOps<java.lang.String,S> styledTextOps()
TextOps specified for a String segment that never merges consecutive stylesstatic <S> TextOps<java.lang.String,S> styledTextOps(java.util.function.BiFunction<S,S,java.util.Optional<S>> mergeStyle)
TextOps specified for a Stringdefault <R> SegmentOps<org.reactfx.util.Either<SEG,R>,S> or(SegmentOps<R,S> rOps)
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.default <RSeg,RStyle> SegmentOps<org.reactfx.util.Either<SEG,RSeg>,org.reactfx.util.Either<S,RStyle>> orStyled(SegmentOps<RSeg,RStyle> rOps)
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.static <LSeg,LStyle,RSeg,RStyle> SegmentOps<org.reactfx.util.Either<LSeg,RSeg>,org.reactfx.util.Either<LStyle,RStyle>> eitherStyles(SegmentOps<LSeg,LStyle> lOps, SegmentOps<RSeg,RStyle> rOps)
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.static <LSeg,RSeg,Style> SegmentOps<org.reactfx.util.Either<LSeg,RSeg>,Style> either(SegmentOps<LSeg,Style> lOps, SegmentOps<RSeg,Style> rOps)
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.static <LSeg,RSeg,Style> SegmentOps<org.reactfx.util.Either<LSeg,RSeg>,Style> either(SegmentOps<LSeg,Style> lOps, SegmentOps<RSeg,Style> rOps, java.util.function.BiFunction<Style,Style,java.util.Optional<Style>> mergeStyle)
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.