public static final class Token.Quantifier extends Token
Token.BackReference, Token.CharacterClass, Token.Kind, Token.LookAheadAssertionBegin, Token.LookAroundAssertionBegin, Token.LookBehindAssertionBegin, Token.Quantifier| Constructor and Description |
|---|
Quantifier(int min,
int max,
boolean greedy) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
boolean |
equalsSemantic(Token.Quantifier o) |
int |
getIndex() |
int |
getMax() |
int |
getMin()
The minimum number of times the quantified element must appear.
|
int |
getZeroWidthIndex() |
int |
hashCode() |
boolean |
hasIndex() |
boolean |
hasZeroWidthIndex() |
boolean |
isGreedy() |
boolean |
isInfiniteLoop() |
boolean |
isUnrollTrivial()
Returns
true iff "unrolling" this quantifier is trivial, i.e. |
boolean |
isWithinThreshold(int threshold)
Returns
true iff both Token.Quantifier.getMin() and Token.Quantifier.getMax() are less or equal
to the given threshold, or infinite Token.Quantifier.isInfiniteLoop(). |
void |
setIndex(int index) |
void |
setZeroWidthIndex(int zeroWidthIndex) |
JsonObject |
toJson() |
String |
toString() |
createAlternation, createBackReference, createCaptureGroupBegin, createCaret, createCharClass, createCharClass, createDollar, createGroupEnd, createLookAheadAssertionBegin, createLookAheadAssertionBegin, createLookBehindAssertionBegin, createLookBehindAssertionBegin, createNonCaptureGroupBegin, createNonWordBoundary, createQuantifier, createWordBoundary, getSourceSection, setSourceSectionpublic boolean isInfiniteLoop()
public int getMin()
a{1111111111111111111,}). Any number which is larger than the maximum size
of the platform's String data type is considered "virtually infinite".public int getMax()
public boolean isGreedy()
public boolean hasIndex()
public int getIndex()
public void setIndex(int index)
public boolean hasZeroWidthIndex()
public int getZeroWidthIndex()
public void setZeroWidthIndex(int zeroWidthIndex)
public boolean isWithinThreshold(int threshold)
true iff both Token.Quantifier.getMin() and Token.Quantifier.getMax() are less or equal
to the given threshold, or infinite Token.Quantifier.isInfiniteLoop().public boolean isUnrollTrivial()
true iff "unrolling" this quantifier is trivial, i.e. nothing has to be
duplicated. This is the case for quantifiers ? and *.public boolean equalsSemantic(Token.Quantifier o)
public JsonObject toJson()
toJson in interface JsonConvertibletoJson in class Token