Package org.commonmark.internal
Class Delimiter
- java.lang.Object
-
- org.commonmark.internal.Delimiter
-
- All Implemented Interfaces:
DelimiterRun
public class Delimiter extends java.lang.Object implements DelimiterRun
Delimiter (emphasis, strong emphasis or custom emphasis).
-
-
Field Summary
Fields Modifier and Type Field Description private booleancanCloseprivate booleancanOpenjava.util.List<Text>characterschardelimiterCharDelimiternextprivate intoriginalLengthDelimiterprevious
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanClose()booleancanOpen()TextgetCloser()java.lang.Iterable<Text>getClosers(int length)Get the closing delimiter nodes for the specified length of delimiters.TextgetOpener()java.lang.Iterable<Text>getOpeners(int length)Get the opening delimiter nodes for the specified length of delimiters.intlength()intoriginalLength()
-
-
-
Field Detail
-
characters
public final java.util.List<Text> characters
-
delimiterChar
public final char delimiterChar
-
originalLength
private final int originalLength
-
canOpen
private final boolean canOpen
-
canClose
private final boolean canClose
-
previous
public Delimiter previous
-
next
public Delimiter next
-
-
Method Detail
-
canOpen
public boolean canOpen()
- Specified by:
canOpenin interfaceDelimiterRun- Returns:
- whether this can open a delimiter
-
canClose
public boolean canClose()
- Specified by:
canClosein interfaceDelimiterRun- Returns:
- whether this can close a delimiter
-
length
public int length()
- Specified by:
lengthin interfaceDelimiterRun- Returns:
- the number of characters in this delimiter run (that are left for processing)
-
originalLength
public int originalLength()
- Specified by:
originalLengthin interfaceDelimiterRun- Returns:
- the number of characters originally in this delimiter run; at the start of processing, this is the same
as {
DelimiterRun.length()}
-
getOpener
public Text getOpener()
- Specified by:
getOpenerin interfaceDelimiterRun- Returns:
- the innermost opening delimiter, e.g. for
***this is the last*
-
getCloser
public Text getCloser()
- Specified by:
getCloserin interfaceDelimiterRun- Returns:
- the innermost closing delimiter, e.g. for
***this is the first*
-
getOpeners
public java.lang.Iterable<Text> getOpeners(int length)
Description copied from interface:DelimiterRunGet the opening delimiter nodes for the specified length of delimiters. Length must be between 1 andDelimiterRun.length().For example, for a delimiter run
***, calling this with 1 would return the last*. Calling it with 2 would return the second last*and the last*.- Specified by:
getOpenersin interfaceDelimiterRun
-
getClosers
public java.lang.Iterable<Text> getClosers(int length)
Description copied from interface:DelimiterRunGet the closing delimiter nodes for the specified length of delimiters. Length must be between 1 andDelimiterRun.length().For example, for a delimiter run
***, calling this with 1 would return the first*. Calling it with 2 would return the first*and the second*.- Specified by:
getClosersin interfaceDelimiterRun
-
-