RangeNode
A single value that can be either inclusive or exclusive. This class is used by Range to define the boundaries of a numerical range.
Fields
POSITIVE_INFINITY
A static RangeNode representing positive infinity, which is always inclusive.
NEGATIVE_INFINITY
A static RangeNode representing negative infinity, which is always inclusive.
Methods
RangeNode(double node, boolean isInclusive)
Constructs a new RangeNode.
node: The numerical value of the node.isInclusive: A boolean indicating whether the node is inclusive (true) or exclusive (false).
inclusive(double value)
Static factory method. Creates a new RangeNode that is inclusive of the given value.
exclusive(double value)
Static factory method. Creates a new RangeNode that is exclusive of the given value.
node()
Returns the numerical value of the node.
isInclusive()
Returns true if the node is inclusive, false otherwise.
isExclusive()
Returns true if the node is exclusive, false otherwise.
isValueGreaterThanNode(double value)
Checks if a given value is greater than or equal to (if inclusive) or strictly greater than (if exclusive) this node's value.
isValueLessThanNode(double value)
Checks if a given value is less than or equal to (if inclusive) or strictly less than (if exclusive) this node's value.
equals(Object obj)
Compares this RangeNode to another object for equality. Two RangeNode objects are equal if they have the same numerical value and the same inclusivity/exclusivity.
hashCode()
Returns a hash code for the RangeNode.
toString()
Returns a string representation of the RangeNode (e.g., "10.0 (inclusive)" or "5.0 (exclusive)").