/** * Determines whether the range is of the form (a, a). * @return true if the range is of the form (a, a), false otherwise. */ private boolean hasSameExclusiveBounds() { return isBounded() && lowerBound.equals(upperBound) && lowerBound.get().isExclusive(); } }
/** * Determines whether the lower endpoint is greater than the upper endpoint. * @return true if the bounds are inverted, false otherwise. */ private boolean hasInvertedBounds() { return isBounded() && lowerEndpoint().get().compareTo(upperEndpoint().get()) > 0; }
/** * Determines whether the range contains no values. A range is empty when it has the form (a, a] or [a, a). * @return true if the range cannot contain any value. */ public boolean isEmpty() { return isBounded() && lowerEndpoint().equals(upperEndpoint()) && lowerBound.get().isExclusive() != upperBound.get().isExclusive(); }