Class Quantifier


  • public final class Quantifier
    extends java.lang.Object
    A regex-style quantifier, specified as a number or pair of numbers in braces.
    • Constructor Summary

      Constructors 
      Constructor Description
      Quantifier​(int min, int max)  
    • 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)
    • Constructor Detail

      • Quantifier

        public Quantifier​(int min,
                          int max)
    • 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:
        toString in class java.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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object