Top Description Fields Constructors Methods
jdk.internal.org.commonmark.internal

pack-priv Class StaggeredDelimiterProcessor

extends Object
implements DelimiterProcessor
Class Inheritance
All Implemented Interfaces
jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor
Imports
jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor, .DelimiterRun, java.util.LinkedList, .ListIterator

An implementation of DelimiterProcessor that dispatches all calls to two or more other DelimiterProcessors depending on the length of the delimiter run. All child DelimiterProcessors must have different minimum lengths. A given delimiter run is dispatched to the child with the largest acceptable minimum length. If no child is applicable, the one with the largest minimum length is chosen.

Field Summary

Modifier and TypeField and Description
private final char
private int
private LinkedList<DelimiterProcessor>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
private DelimiterProcessor
findProcessor(int len)

public char
public int
getMinLength()

Implements jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.getMinLength.

Minimum number of delimiter characters that are needed to activate this.

public char
public int
process(DelimiterRun
the opening delimiter run
openingRun
,
DelimiterRun
the closing delimiter run
closingRun
)

Implements jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.process.

Process the delimiter runs.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delimback to summary
private final char delim
minLengthback to summary
private int minLength
processorsback to summary
private LinkedList<DelimiterProcessor> processors

Constructor Detail

StaggeredDelimiterProcessorback to summary
pack-priv StaggeredDelimiterProcessor(char delim)

Method Detail

addback to summary
pack-priv void add(DelimiterProcessor dp)
findProcessorback to summary
private DelimiterProcessor findProcessor(int len)
getClosingCharacterback to summary
public char getClosingCharacter()

Implements jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.getClosingCharacter.

Returns:char

Doc from jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.getClosingCharacter.

the character that marks the the ending of a delimited node, must not clash with any built-in special characters. Note that for a symmetric delimiter such as "*", this is the same as the opening.

Annotations
@Override
getMinLengthback to summary
public int getMinLength()

Implements jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.getMinLength.

Doc from jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.getMinLength.

Minimum number of delimiter characters that are needed to activate this. Must be at least 1.

Annotations
@Override
getOpeningCharacterback to summary
public char getOpeningCharacter()

Implements jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.getOpeningCharacter.

Returns:char

Doc from jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.getOpeningCharacter.

the character that marks the beginning of a delimited node, must not clash with any built-in special characters

Annotations
@Override
processback to summary
public int process(DelimiterRun openingRun, DelimiterRun closingRun)

Implements jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.process.

Doc from jdk.internal.org.commonmark.parser.delimiter.DelimiterProcessor.process.

Process the delimiter runs.

The processor can examine the runs and the nodes and decide if it wants to process or not. If not, it should not change any nodes and return 0. If yes, it should do the processing (wrapping nodes, etc) and then return how many delimiters were used.

Note that removal (unlinking) of the used delimiter Text nodes is done by the caller.

Parameters
openingRun:DelimiterRun

the opening delimiter run

closingRun:DelimiterRun

the closing delimiter run

Returns:int

how many delimiters were used; must not be greater than length of either opener or closer

Annotations
@Override