Package org.commonmark.internal
Class Delimiter
java.lang.Object
org.commonmark.internal.Delimiter
- All Implemented Interfaces:
DelimiterRun
Delimiter (emphasis, strong emphasis or custom emphasis).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final boolean
final char
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canClose()
boolean
canOpen()
getClosers
(int length) Get the closing delimiter nodes for the specified length of delimiters.getOpeners
(int length) Get the opening delimiter nodes for the specified length of delimiters.int
length()
int
-
Field Details
-
characters
-
delimiterChar
public final char delimiterChar -
originalLength
private final int originalLength -
canOpen
private final boolean canOpen -
canClose
private final boolean canClose -
previous
-
next
-
-
Constructor Details
-
Delimiter
-
-
Method Details
-
canOpen
public boolean canOpen()- Specified by:
canOpen
in interfaceDelimiterRun
- Returns:
- whether this can open a delimiter
-
canClose
public boolean canClose()- Specified by:
canClose
in interfaceDelimiterRun
- Returns:
- whether this can close a delimiter
-
length
public int length()- Specified by:
length
in interfaceDelimiterRun
- Returns:
- the number of characters in this delimiter run (that are left for processing)
-
originalLength
public int originalLength()- Specified by:
originalLength
in interfaceDelimiterRun
- Returns:
- the number of characters originally in this delimiter run; at the start of processing, this is the same
as {
DelimiterRun.length()
}
-
getOpener
- Specified by:
getOpener
in interfaceDelimiterRun
- Returns:
- the innermost opening delimiter, e.g. for
***
this is the last*
-
getCloser
- Specified by:
getCloser
in interfaceDelimiterRun
- Returns:
- the innermost closing delimiter, e.g. for
***
this is the first*
-
getOpeners
Description copied from interface:DelimiterRun
Get 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:
getOpeners
in interfaceDelimiterRun
-
getClosers
Description copied from interface:DelimiterRun
Get 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:
getClosers
in interfaceDelimiterRun
-