Package com.qfs.util

Class IRangeUnion.Range

    • Field Detail

      • from

        public final long from
        Beginning of the range (inclusive).
      • to

        public final long to
        End of the range (inclusive).
    • Constructor Detail

      • Range

        public Range​(long from,
                     long to)
        Constructor.
        Parameters:
        from - beginning of the range (inclusive)
        to - end of the range (inclusive)
    • Method Detail

      • from

        public long from()
        Gets the defined "from" bound (inclusive).
        Returns:
        the lower bound
      • to

        public long to()
        Gets the defined "to" bound (inclusive).
        Returns:
        the upper bound
      • isIncludedIn

        public boolean isIncludedIn​(IRangeUnion.Range other)
        Test if this range is included into another range. Expects from to be lower than to on this range and the other range.
        Parameters:
        other - the other range that might include this range.
        Returns:
        true if this range is included in the other range.
      • isDisjoint

        public boolean isDisjoint​(IRangeUnion.Range other)
        Test if this range is of intersection null with another range.
        Parameters:
        other - other range to compare to this
        Returns:
        true if the range are disjoint, false otherwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • contain

        public boolean contain​(long x)