Package spoon.pattern
Enum Quantifier
- All Implemented Interfaces:
Serializable
,Comparable<Quantifier>
Defines a matching strategy for pattern parameters, default is
GREEDY
.-
Enum Constant Summary
Enum ConstantDescriptionForce the matcher to read in, or eat, the entire input prior to attempting the next match (default).The possessive quantifier always eats the entire input string, trying once (and only once) for a match.The reluctant quantifier takes the opposite approach: It start at the beginning of the input, then reluctantly eats one character at a time looking for a match. -
Method Summary
Modifier and TypeMethodDescriptionstatic Quantifier
Returns the enum constant of this type with the specified name.static Quantifier[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
GREEDY
Force the matcher to read in, or eat, the entire input prior to attempting the next match (default). If the next match attempt (the entire input) fails, the matcher backs off the input by one and tries again, repeating the process until a match is found or there are no more elements left to back off from. -
RELUCTANT
The reluctant quantifier takes the opposite approach: It start at the beginning of the input, then reluctantly eats one character at a time looking for a match. The last thing it tries is the entire input. -
POSSESSIVE
The possessive quantifier always eats the entire input string, trying once (and only once) for a match. Unlike the greedy quantifiers, possessive quantifiers never back off, even if doing so would allow the overall match to succeed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-