Class OrderedSetIntervalND<T extends Comparable<T>>
java.lang.Object
org.episteme.core.mathematics.algebra.intervals.OrderedSetIntervalND<T>
- All Implemented Interfaces:
Interval<T>
- Direct Known Subclasses:
RingIntervalND
N-dimensional interval over an ordered set (elements must be Comparable).
This is the most basic interval implementation, requiring only that elements support comparison operations. Suitable for any totally ordered set.
Supports containment checks, subset testing, and overlap detection.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
ConstructorsConstructorDescriptionOrderedSetIntervalND(T[] min, T[] max) Creates a closed N-dimensional interval [min, max].OrderedSetIntervalND(T[] min, T[] max, boolean[] closedLeft, boolean[] closedRight) Creates an N-dimensional interval with specified bounds and endpoint types.OrderedSetIntervalND(T min, T max) Creates a closed 1-dimensional interval [min, max].OrderedSetIntervalND(T min, T max, boolean closedLeft, boolean closedRight) Creates a 1-dimensional interval. -
Method Summary
Modifier and TypeMethodDescriptionboundingInterval(Interval<T> other) Returns the smallest interval containing both this and another interval.booleanChecks if this interval contains another interval entirely.booleanChecks if a point is contained in this interval.booleanintReturns the number of dimensions of this interval.getMax(int dimension) Returns the upper bound in the specified dimension.getMin(int dimension) Returns the lower bound in the specified dimension.inthashCode()intersection(Interval<T> other) Returns the intersection of this interval with another.booleanisClosedLeft(int dimension) Returns whether the lower endpoint is closed in the specified dimension.booleanisClosedRight(int dimension) Returns whether the upper endpoint is closed in the specified dimension.booleanisEmpty()Returns whether this interval is empty.notation()Returns the standard mathematical notation for this interval.booleanChecks if this interval overlaps with another.toString()
-
Constructor Details
-
OrderedSetIntervalND
Creates an N-dimensional interval with specified bounds and endpoint types.- Parameters:
min- array of minimum values for each dimensionmax- array of maximum values for each dimensionclosedLeft- array indicating if left endpoints are closedclosedRight- array indicating if right endpoints are closed
-
OrderedSetIntervalND
-
OrderedSetIntervalND
-
OrderedSetIntervalND
-
-
Method Details
-
getDimension
public int getDimension()Description copied from interface:IntervalReturns the number of dimensions of this interval.- Specified by:
getDimensionin interfaceInterval<T extends Comparable<T>>- Returns:
- the dimensionality (1 for 1D intervals, N for ND)
-
getMin
-
getMax
-
isClosedLeft
public boolean isClosedLeft(int dimension) Description copied from interface:IntervalReturns whether the lower endpoint is closed in the specified dimension.- Specified by:
isClosedLeftin interfaceInterval<T extends Comparable<T>>- Parameters:
dimension- the dimension index (0-based)- Returns:
- true if the interval includes its minimum value in that dimension
-
isClosedRight
public boolean isClosedRight(int dimension) Description copied from interface:IntervalReturns whether the upper endpoint is closed in the specified dimension.- Specified by:
isClosedRightin interfaceInterval<T extends Comparable<T>>- Parameters:
dimension- the dimension index (0-based)- Returns:
- true if the interval includes its maximum value in that dimension
-
contains
-
contains
-
overlaps
-
intersection
Description copied from interface:IntervalReturns the intersection of this interval with another.- Specified by:
intersectionin interfaceInterval<T extends Comparable<T>>- Parameters:
other- the interval to intersect with- Returns:
- the intersection interval, or null if empty
-
boundingInterval
Description copied from interface:IntervalReturns the smallest interval containing both this and another interval.- Specified by:
boundingIntervalin interfaceInterval<T extends Comparable<T>>- Parameters:
other- the interval to union with- Returns:
- the bounding interval
-
isEmpty
-
notation
-
toString
-
equals
-
hashCode
-