public static final class Token.Quantifier extends Token
Token.BackReference, Token.CharacterClass, Token.CharacterClassAtom, Token.ClassSet, Token.InlineFlags, Token.Kind, Token.LiteralCharacter, Token.LookAheadAssertionBegin, Token.LookAroundAssertionBegin, Token.LookBehindAssertionBegin, Token.Quantifier| Modifier and Type | Field and Description |
|---|---|
static int |
INFINITY |
| Constructor and Description |
|---|
Quantifier(int min,
int max,
boolean greedy) |
Quantifier(int min,
int max,
boolean greedy,
boolean possessive) |
| 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 |
isDead()
Returns
true if the quantified term can never match. |
boolean |
isGreedy() |
boolean |
isInfiniteLoop() |
boolean |
isPossessive() |
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() |
createA, createAlternation, createAtomicGroupBegin, createBackReference, createBackReference, createCaptureGroupBegin, createCaret, createCharacterClassAtom, createCharacterClassBegin, createCharacterClassEnd, createCharClass, createCharClass, createClassSetExpression, createConditionalBackReference, createDollar, createGroupEnd, createInlineFlags, createLiteralCharacter, createLookAheadAssertionBegin, createLookAheadAssertionBegin, createLookBehindAssertionBegin, createLookBehindAssertionBegin, createNonCaptureGroupBegin, createNonWordBoundary, createQuantifier, createQuantifier, createWordBoundary, createZ, createZLowerCase, getPosition, getSourceSection, setPosition, setSourceSectionpublic static final int INFINITY
public Quantifier(int min,
int max,
boolean greedy,
boolean possessive)
public Quantifier(int min,
int max,
boolean greedy)
public 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 isPossessive()
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 isDead()
true if the quantified term can never match. This is the case when:
OracleDBFlavor this can happen due
to a quirk in the integer overflow handling in bounded quantifiers, see
OracleDBRegexLexer.public boolean equalsSemantic(Token.Quantifier o)
public JsonObject toJson()
toJson in interface JsonConvertibletoJson in class Token