Package org.spongepowered.asm.util
Class Quantifier
- java.lang.Object
-
- org.spongepowered.asm.util.Quantifier
-
public final class Quantifier extends java.lang.ObjectA regex-style quantifier, specified as a number or pair of numbers in braces.
-
-
Field Summary
Fields Modifier and Type Field Description static QuantifierANYDefault (matches any)static QuantifierDEFAULTDefault quantifier, used when a quantifier was not specified (empty string)static QuantifierNONEInvalid (matches none)static QuantifierPLUSPlus (matches 1 or more)static QuantifierSINGLESingle (matches zero or 1)
-
Constructor Summary
Constructors Constructor Description Quantifier(int min, int max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)intgetClampedMax()Get the clamped max valueintgetClampedMin()Get the clamped min valueintgetMax()Get the literal max valueintgetMin()Get the literal min valueinthashCode()booleanisDefault()Check whether this is a defaulted qualifierstatic Quantifierparse(java.lang.String string)Parse a quantifier from the supplied stringjava.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT
public static Quantifier DEFAULT
Default quantifier, used when a quantifier was not specified (empty string)
-
NONE
public static Quantifier NONE
Invalid (matches none)
-
SINGLE
public static Quantifier SINGLE
Single (matches zero or 1)
-
ANY
public static Quantifier ANY
Default (matches any)
-
PLUS
public static Quantifier PLUS
Plus (matches 1 or more)
-
-
Method Detail
-
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
parse
public static Quantifier parse(java.lang.String string)
Parse a quantifier from the supplied string- Parameters:
string- string to parse- Returns:
- parsed quantifier, malformed quantifiers return NONE
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-