Top Description Fields Constructors Methods
com.vladsch.flexmark.util.sequence.builder

public final Class RichSequenceBuilder

extends Object
implements ISequenceBuilder<RichSequenceBuilder, RichSequence>
Class Inheritance
All Implemented Interfaces
com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder, java.lang.Appendable
Imports
com.vladsch.flexmark.util.sequence.RichSequence, org.jetbrains.annotations.NotNull, .Nullable

A Builder for non based strings. Just a string builder wrapped in a sequence builder interface and wrapping result in RichSequence

Field Summary

Modifier and TypeField and Description
private final StringBuilder

Constructor Summary

AccessConstructor and Description
private
public
RichSequenceBuilder(int initialCapacity)

Method Summary

Modifier and TypeMethod and Description
public @NotNull RichSequenceBuilder
append(@Nullable CharSequence
The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null".
chars
,
int
The index of the first character in the subsequence
startIndex
,
int
The index of the character following the last character in the subsequence
endIndex
)

Implements java.lang.Appendable.append.

Appends a subsequence of the specified character sequence to this Appendable.

public @NotNull RichSequenceBuilder
append(char
The character to append
c
)

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.append.

Appends the specified character to this Appendable.

public @NotNull RichSequenceBuilder
public char
public static @NotNull RichSequenceBuilder
public @NotNull RichSequenceBuilder
public @NotNull RichSequence
public int
public @NotNull RichSequence
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

segmentsback to summary
private final StringBuilder segments

Constructor Detail

RichSequenceBuilderback to summary
private RichSequenceBuilder()
RichSequenceBuilderback to summary
public RichSequenceBuilder(int initialCapacity)

Method Detail

appendback to summary
public @NotNull RichSequenceBuilder append(@Nullable CharSequence chars, int startIndex, int endIndex)

Implements java.lang.Appendable.append.

Doc from java.lang.Appendable.append.

Appends a subsequence of the specified character sequence to this Appendable.

An invocation of this method of the form out.append(csq, start, end) when csq is not null, behaves in exactly the same way as the invocation

    out.append(csq.subSequence(start, end)) 

The contents of this Appendable are unspecified if the CharSequence is modified during the method call or an exception is thrown when accessing the CharSequence.

Parameters
chars:@Nullable CharSequence

The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null".

startIndex:int

The index of the first character in the subsequence

endIndex:int

The index of the character following the last character in the subsequence

Returns:@NotNull RichSequenceBuilder

A reference to this Appendable

Annotations
@NotNull
@Override
appendback to summary
public @NotNull RichSequenceBuilder append(char c)

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.append.

Doc from java.lang.Appendable.append.

Appends the specified character to this Appendable.

Parameters
c:char

The character to append

Returns:@NotNull RichSequenceBuilder

A reference to this Appendable

Annotations
@NotNull
@Override
appendback to summary
public @NotNull RichSequenceBuilder append(char c, int count)

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.append.

Annotations
@NotNull
@Override
charAtback to summary
public char charAt(int index)

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.charAt.

Annotations
@Override
emptyBuilderback to summary
public static @NotNull RichSequenceBuilder emptyBuilder()
Annotations
@NotNull
getBuilderback to summary
public @NotNull RichSequenceBuilder getBuilder()

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.getBuilder.

Annotations
@NotNull
getSingleBasedSequenceback to summary
public @NotNull RichSequence getSingleBasedSequence()

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.getSingleBasedSequence.

Doc from com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.getSingleBasedSequence.

Note

returns non-null value if the underlying IBasedSegmentBuilder#getBaseSubSequenceRange() returns non-null value

Returns:@NotNull RichSequence

sub-sequence of base representing the single segment or null if sequence not representable by a single subsequence

Annotations
@NotNull
@Override
lengthback to summary
public int length()

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.length.

Annotations
@Override
toSequenceback to summary
public @NotNull RichSequence toSequence()

Implements com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.toSequence.

Annotations
@NotNull
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override