Class AbstractInterval<E extends Comparable<E>,​ME extends AbstractInterval<E,​ME>>

    • Constructor Detail

      • AbstractInterval

        public AbstractInterval​(E left,
                                E right)
      • AbstractInterval

        public AbstractInterval​(E left,
                                E right,
                                boolean bLeftClosed,
                                boolean bRightClosed,
                                boolean bReverse)
    • Method Detail

      • isLeftClosed

        public boolean isLeftClosed()
        Specified by:
        isLeftClosed in interface IInterval<E extends Comparable<E>,​ME extends AbstractInterval<E,​ME>>
        Returns:
        True if this interval includes the left endpoint. E.g., x >= foo indicates a left-closed interval starting with and including foo. Conversely, x > foo is said to be left-open because the interface starts with, but excludes foo i.e., there is no minimum value defined in the interval, rather the interval is open with foo as the limit of minimum values.
      • isRightClosed

        public boolean isRightClosed()
        Specified by:
        isRightClosed in interface IInterval<E extends Comparable<E>,​ME extends AbstractInterval<E,​ME>>
        Returns:
        True if this interval includes the right endpoint. E.g., x <= foo indicates a right-closed interval ending with and including foo. Conversely, x < foo is said to be right-open because the interface ends with, but excludes foo i.e., there is no maximum value defined in the interval, rather the interval is open with foo as the limit of maximum values.
      • contains

        public boolean contains​(E e)
        Specified by:
        contains in interface IInterval<E extends Comparable<E>,​ME extends AbstractInterval<E,​ME>>
        Parameters:
        e - An element to test
        Returns:
        True if elem is a proper element in the set of elements defining this interval.
      • contains

        public boolean contains​(ME interval)
        Specified by:
        contains in interface IInterval<E extends Comparable<E>,​ME extends AbstractInterval<E,​ME>>
        Parameters:
        interval - An interval to test for containment
        Returns:
        True if interval's endpoints are proper elements in the set of elements defining this interval.
      • isReverse

        public boolean isReverse()
        Specified by:
        isReverse in interface IInterval<E extends Comparable<E>,​ME extends AbstractInterval<E,​ME>>
        Returns:
        True if this interval iterates from the right by default e.g., if the interval is specified in reverse order: 10..1, Gosu will create a reverse intervall
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object