Top Fields Constructors Methods
org.fxmisc.richtext.model

pack-priv Class EitherSegmentOps<L, R, S>

Located in compilation unit of org.fxmisc.richtext.model.SegmentOps.

extends Object
implements SegmentOps<Either<L, R>, S>
Class Inheritance
All Implemented Interfaces
org.fxmisc.richtext.model.SegmentOps
Known Direct Subclasses
org.fxmisc.richtext.model.LeftTextOps, org.fxmisc.richtext.model.RightTextOps

Field Summary

Modifier and TypeField and Description
private final SegmentOps<L, S>
private final BiFunction<S, S, Optional<S>>
private final SegmentOps<R, S>

Constructor Summary

AccessConstructor and Description
pack-priv
EitherSegmentOps(SegmentOps<L, S> lOps, SegmentOps<R, S> rOps, BiFunction<S, S, Optional<S>> mergeStyle)

Method Summary

Modifier and TypeMethod and Description
public char
public Either<L, R>
public String
public Optional<Either<L, R>>
joinSeg(Either<L, R> left, Either<L, R> right)

Implements org.fxmisc.richtext.model.SegmentOps.joinSeg.

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

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

Overrides default org.fxmisc.richtext.model.SegmentOps.joinStyle.

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

public int
public Either<L, R>
subSequence(Either<L, R> seg, int start, int end)

Implements org.fxmisc.richtext.model.SegmentOps.subSequence.

public Either<L, R>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lOpsback to summary
private final SegmentOps<L, S> lOps
mergeStyleback to summary
private final BiFunction<S, S, Optional<S>> mergeStyle
rOpsback to summary
private final SegmentOps<R, S> rOps

Constructor Detail

EitherSegmentOpsback to summary
pack-priv EitherSegmentOps(SegmentOps<L, S> lOps, SegmentOps<R, S> rOps, BiFunction<S, S, Optional<S>> mergeStyle)

Method Detail

charAtback to summary
public char charAt(Either<L, R> seg, int index)

Implements org.fxmisc.richtext.model.SegmentOps.charAt.

Annotations
@Override
createEmptySegback to summary
public Either<L, R> createEmptySeg()

Implements org.fxmisc.richtext.model.SegmentOps.createEmptySeg.

Doc from org.fxmisc.richtext.model.SegmentOps.createEmptySeg.

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

getTextback to summary
public String getText(Either<L, R> seg)

Implements org.fxmisc.richtext.model.SegmentOps.getText.

Annotations
@Override
joinSegback to summary
public Optional<Either<L, R>> joinSeg(Either<L, R> left, Either<L, R> right)

Implements org.fxmisc.richtext.model.SegmentOps.joinSeg.

Doc from org.fxmisc.richtext.model.SegmentOps.joinSeg.

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

Annotations
@Override
joinStyleback to summary
public Optional<S> joinStyle(S currentStyle, S nextStyle)

Overrides default org.fxmisc.richtext.model.SegmentOps.joinStyle.

Doc from org.fxmisc.richtext.model.SegmentOps.joinStyle.

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

Annotations
@Override
lengthback to summary
public int length(Either<L, R> seg)

Implements org.fxmisc.richtext.model.SegmentOps.length.

Annotations
@Override
subSequenceback to summary
public Either<L, R> subSequence(Either<L, R> seg, int start, int end)

Implements org.fxmisc.richtext.model.SegmentOps.subSequence.

Annotations
@Override
subSequenceback to summary
public Either<L, R> subSequence(Either<L, R> seg, int start)

Implements org.fxmisc.richtext.model.SegmentOps.subSequence.

Annotations
@Override