Class AbstractInterval

    • Field Detail

      • value

        protected final long value
        Interval value
      • positive

        protected final boolean positive
        Cache that remembers if the interval is positive
    • Constructor Detail

      • AbstractInterval

        protected AbstractInterval​(long value)
        Create an interval from a long integer value.
        Parameters:
        value - long integer value
      • AbstractInterval

        protected AbstractInterval​(long absoluteValue,
                                   boolean positive)
        Create an interval from an absolute value and a sign.
        Parameters:
        absoluteValue - absolute interval value
        positive - sign indicator
    • Method Detail

      • parseMatchingGroupToLong

        protected static long parseMatchingGroupToLong​(Matcher matcher,
                                                       int groupNumber)
        Parse a group that came out of a string match to an interval.
        Parameters:
        matcher - matcher applied on the interval string
        groupNumber - group that matched
        Returns:
        long value representing the interval
      • getSign

        protected String getSign()
        Produce the sign of the interval.
        Returns:
        "+" if positive, "-" if negative
      • getSignedValue

        protected long getSignedValue()
        Get the signed long integer value.
        Returns:
        signed value