Top Fields Constructors Methods
com.vladsch.flexmark.util.ast

public Class SpaceInsertingSequenceBuilder

extends Object
implements ISequenceBuilder<SpaceInsertingSequenceBuilder, BasedSequence>
Class Inheritance
All Implemented Interfaces
com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder, java.lang.Appendable
Imports
com.vladsch.flexmark.util.misc.BitFieldSet, .CharPredicate, com.vladsch.flexmark.util.sequence.BasedSequence, .Range, com.vladsch.flexmark.util.sequence.builder.BasedSegmentBuilder, .ISequenceBuilder, .SegmentOptimizer, .SequenceBuilder, org.jetbrains.annotations.NotNull, .Nullable

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv final boolean
pack-priv Node
pack-priv boolean
pack-priv final SequenceBuilder

Constructor Summary

AccessConstructor and Description
private
SpaceInsertingSequenceBuilder(SequenceBuilder out, boolean addSpacesBetweenNodes)

Method Summary

Modifier and TypeMethod and Description
public @NotNull SpaceInsertingSequenceBuilder
public @NotNull SpaceInsertingSequenceBuilder
public @NotNull SpaceInsertingSequenceBuilder
addByLength(int startOffset, int textLength)

public @NotNull SpaceInsertingSequenceBuilder
addByOffsets(int startOffset, int endOffset)

public @NotNull SpaceInsertingSequenceBuilder
public @NotNull SpaceInsertingSequenceBuilder
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 SpaceInsertingSequenceBuilder
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 SpaceInsertingSequenceBuilder
public @NotNull SpaceInsertingSequenceBuilder
append(int startOffset, int endOffset)

public @NotNull SpaceInsertingSequenceBuilder
public @NotNull SpaceInsertingSequenceBuilder
public @NotNull SpaceInsertingSequenceBuilder
append(@Nullable CharSequence
The character sequence to append. If csq is null, then the four characters "null" are appended to this Appendable.
chars
)

Implements java.lang.Appendable.append.

Appends the specified character sequence to this Appendable.

public @NotNull SpaceInsertingSequenceBuilder
append(@Nullable CharSequence chars, int startIndex)

public void
public char
public static @NotNull SpaceInsertingSequenceBuilder
public static @NotNull SpaceInsertingSequenceBuilder
public static @NotNull SpaceInsertingSequenceBuilder
emptyBuilder(@NotNull BasedSequence base, int options)

public static @NotNull SpaceInsertingSequenceBuilder
public static @NotNull SpaceInsertingSequenceBuilder
public @NotNull BasedSequence
public @NotNull SpaceInsertingSequenceBuilder
public Node
public SequenceBuilder
public @NotNull BasedSegmentBuilder
public @Nullable BasedSequence
public boolean
public int
public boolean
public boolean
public void
setLastNode(Node lastNode)

public void
setNeedEol(boolean needEol)

public @NotNull BasedSequence
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public String
public @NotNull String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

addSpacesback to summary
pack-priv boolean addSpaces
addSpacesBetweenNodesback to summary
pack-priv final boolean addSpacesBetweenNodes
lastNodeback to summary
pack-priv Node lastNode
needEolback to summary
pack-priv boolean needEol
outback to summary
pack-priv final SequenceBuilder out

Constructor Detail

SpaceInsertingSequenceBuilderback to summary
private SpaceInsertingSequenceBuilder(SequenceBuilder out, boolean addSpacesBetweenNodes)

Method Detail

addback to summary
public @NotNull SpaceInsertingSequenceBuilder add(@Nullable CharSequence chars)
Annotations
@Override
@NotNull
addAllback to summary
public @NotNull SpaceInsertingSequenceBuilder addAll(Iterable<? extends CharSequence> sequences)

Overrides default com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.addAll.

Annotations
@Override
@NotNull
addByLengthback to summary
public @NotNull SpaceInsertingSequenceBuilder addByLength(int startOffset, int textLength)
Annotations
@NotNull
addByOffsetsback to summary
public @NotNull SpaceInsertingSequenceBuilder addByOffsets(int startOffset, int endOffset)
Annotations
@NotNull
addRangeback to summary
public @NotNull SpaceInsertingSequenceBuilder addRange(@NotNull Range range)
Annotations
@NotNull
appendback to summary
public @NotNull SpaceInsertingSequenceBuilder 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 SpaceInsertingSequenceBuilder

A reference to this Appendable

Annotations
@Override
@NotNull
appendback to summary
public @NotNull SpaceInsertingSequenceBuilder 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 SpaceInsertingSequenceBuilder

A reference to this Appendable

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

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

Annotations
@Override
@NotNull
appendback to summary
public @NotNull SpaceInsertingSequenceBuilder append(int startOffset, int endOffset)
Annotations
@NotNull
appendback to summary
public @NotNull SpaceInsertingSequenceBuilder append(@NotNull Range chars)
Annotations
@NotNull
appendback to summary
public @NotNull SpaceInsertingSequenceBuilder append(Iterable<? extends CharSequence> sequences)

Overrides default com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder.append.

Annotations
@Override
@NotNull
appendback to summary
public @NotNull SpaceInsertingSequenceBuilder append(@Nullable CharSequence chars)

Implements java.lang.Appendable.append.

Doc from java.lang.Appendable.append.

Appends the specified character sequence to this Appendable.

Depending on which class implements the character sequence csq, the entire sequence may not be appended. For instance, if csq is a java.nio.CharBuffer then the subsequence to append is defined by the buffer's position and limit.

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 to append. If csq is null, then the four characters "null" are appended to this Appendable.

Returns:@NotNull SpaceInsertingSequenceBuilder

A reference to this Appendable

Annotations
@Override
@NotNull
appendback to summary
public @NotNull SpaceInsertingSequenceBuilder append(@Nullable CharSequence chars, int startIndex)
Annotations
@Override
@NotNull
appendEolback to summary
public void appendEol()
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 SpaceInsertingSequenceBuilder emptyBuilder(@NotNull BasedSequence base)
Annotations
@NotNull
emptyBuilderback to summary
public static @NotNull SpaceInsertingSequenceBuilder emptyBuilder(@NotNull BasedSequence base, @NotNull SegmentOptimizer optimizer)
Annotations
@NotNull
emptyBuilderback to summary
public static @NotNull SpaceInsertingSequenceBuilder emptyBuilder(@NotNull BasedSequence base, int options)
Annotations
@NotNull
emptyBuilderback to summary
public static @NotNull SpaceInsertingSequenceBuilder emptyBuilder(@NotNull BasedSequence base, int options, @NotNull SegmentOptimizer optimizer)
Annotations
@NotNull
emptyBuilderback to summary
public static @NotNull SpaceInsertingSequenceBuilder emptyBuilder(@NotNull SequenceBuilder builder)
Annotations
@NotNull
getBaseSequenceback to summary
public @NotNull BasedSequence getBaseSequence()
Annotations
@NotNull
getBuilderback to summary
public @NotNull SpaceInsertingSequenceBuilder getBuilder()

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

Annotations
@Override
@NotNull
getLastNodeback to summary
public Node getLastNode()
getOutback to summary
public SequenceBuilder getOut()
getSegmentBuilderback to summary
public @NotNull BasedSegmentBuilder getSegmentBuilder()
Annotations
@NotNull
getSingleBasedSequenceback to summary
public @Nullable BasedSequence 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:@Nullable BasedSequence

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

Annotations
@Override
@Nullable
isNeedEolback to summary
public boolean isNeedEol()
lengthback to summary
public int length()

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

Annotations
@Override
needEolback to summary
public boolean needEol()
needSpaceback to summary
public boolean needSpace()
setLastNodeback to summary
public void setLastNode(Node lastNode)
setNeedEolback to summary
public void setNeedEol(boolean needEol)
toSequenceback to summary
public @NotNull BasedSequence toSequence()

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

Annotations
@Override
@NotNull
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
toStringNoAddedSpacesback to summary
public String toStringNoAddedSpaces()
toStringWithRangesback to summary
public @NotNull String toStringWithRanges()
Annotations
@NotNull