Package org.spongepowered.asm.util
Class Quantifier
java.lang.Object
org.spongepowered.asm.util.Quantifier
A regex-style quantifier, specified as a number or pair of numbers in braces.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic QuantifierDefault (matches any)static QuantifierDefault quantifier, used when a quantifier was not specified (empty string)static QuantifierInvalid (matches none)static QuantifierPlus (matches 1 or more)static QuantifierSingle (matches zero or 1) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGet the clamped max valueintGet the clamped min valueintgetMax()Get the literal max valueintgetMin()Get the literal min valueinthashCode()booleanCheck whether this is a defaulted qualifierstatic QuantifierParse a quantifier from the supplied stringtoString()
-
Field Details
-
DEFAULT
Default quantifier, used when a quantifier was not specified (empty string) -
NONE
Invalid (matches none) -
SINGLE
Single (matches zero or 1) -
ANY
Default (matches any) -
PLUS
Plus (matches 1 or more)
-
-
Constructor Details
-
Quantifier
public Quantifier(int min, int max)
-
-
Method Details
-
isDefault
public boolean isDefault()Check whether this is a defaulted qualifier -
getMin
public int getMin()Get the literal min value -
getMax
public int getMax()Get the literal max value -
getClampedMin
public int getClampedMin()Get the clamped min value -
getClampedMax
public int getClampedMax()Get the clamped max value -
toString
-
parse
Parse a quantifier from the supplied string- Parameters:
string- string to parse- Returns:
- parsed quantifier, malformed quantifiers return NONE
-
equals
-
hashCode
public int hashCode()
-