public final class CartesianBounds extends Object implements IEquatable<CartesianBounds>, IEquatableEpsilon<CartesianBounds>, ImmutableValueType
Cartesian
values which form the bounds of a range of cartesian coordinates.Constructor and Description |
---|
CartesianBounds()
Initializes a new instance.
|
CartesianBounds(Cartesian lowerBound,
Cartesian upperBound)
Holds two
Cartesian values which form the bounds of a range of cartesian coordinates. |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(CartesianBounds left,
CartesianBounds right)
Returns
true if the two instances are exactly equal. |
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
boolean |
equalsEpsilon(CartesianBounds other,
double epsilon)
Indicates whether each value of another instance of this type
is within the required tolerance of the corresponding value of this instance.
|
boolean |
equalsType(CartesianBounds other)
Indicates whether another instance of this type is exactly equal to this instance.
|
boolean |
getIsFinite()
Gets a value indicating whether this instance has a finite range.
|
boolean |
getIsUnbounded()
Gets a value indicating whether this instance ranges from
Double.NEGATIVE_INFINITY to Double.POSITIVE_INFINITY for all coordinates. |
boolean |
getIsUndefined()
Gets a value indicating whether any of the bounds coordinates for this instance have the value
Double.NaN . |
Cartesian |
getLowerBound()
Gets the minimal value defining the bounds.
|
static CartesianBounds |
getUnbounded()
Gets a set of
CartesianBounds representing the full range of real values from negative infinity to positive infinity. |
static CartesianBounds |
getUndefined()
Gets a set of
CartesianBounds with values of Double.NaN . |
Cartesian |
getUpperBound()
Gets the maximal value defining the bounds.
|
Bounds |
getXBounds()
Gets the bounds for the X coordinate.
|
Bounds |
getYBounds()
Gets the bounds for the Y coordinate.
|
Bounds |
getZBounds()
Gets the bounds for the Z coordinate.
|
int |
hashCode()
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
|
static boolean |
notEquals(CartesianBounds left,
CartesianBounds right)
Returns
true if the two instances are not exactly equal. |
String |
toString()
Returns the string representation of the value of this instance.
|
public CartesianBounds()
public CartesianBounds(@Nonnull Cartesian lowerBound, @Nonnull Cartesian upperBound)
Cartesian
values which form the bounds of a range of cartesian coordinates.lowerBound
- The minimal values defining the bounds.upperBound
- The maximal values defining the bounds.ArgumentException
- Thrown when the upperBound
is less than the lowerBound
or when
one value in a given coordinate is Double.NaN
and the other is not.@Nonnull public static CartesianBounds getUnbounded()
CartesianBounds
representing the full range of real values from negative infinity to positive infinity.
Use IsUnbounded
(get
) to test whether a CartesianBounds
instance is unbounded
since it will return true
if all the values range from Double.NEGATIVE_INFINITY
to Double.POSITIVE_INFINITY
.
@Nonnull public static CartesianBounds getUndefined()
CartesianBounds
with values of Double.NaN
.
Use IsUndefined
(get
) to test whether a CartesianBounds
instance
is undefined since it will return true
if any of the values
are Double.NaN
.
@Nonnull public final Cartesian getLowerBound()
@Nonnull public final Cartesian getUpperBound()
public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare to this instance.true
if obj
is an instance of this type and represents the same value as this instance; otherwise false
.Object.hashCode()
,
HashMap
public final boolean equalsType(@Nonnull CartesianBounds other)
equalsType
in interface IEquatable<CartesianBounds>
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.public final boolean equalsEpsilon(@Nonnull CartesianBounds other, double epsilon)
equalsEpsilon
in interface IEquatableEpsilon<CartesianBounds>
other
- The set of CartesianBounds
to compare to this instance.epsilon
- The limit at which the absolute differences between the values will not be considered equal.true
if the absolute differences are less than or equal to epsilon
; otherwise false
.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString()
public static boolean equals(@Nonnull CartesianBounds left, @Nonnull CartesianBounds right)
true
if the two instances are exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
represents the same value as right
; otherwise false
.public static boolean notEquals(@Nonnull CartesianBounds left, @Nonnull CartesianBounds right)
true
if the two instances are not exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
does not represent the same value as right
; otherwise false
.public final boolean getIsFinite()
public final boolean getIsUnbounded()
Double.NEGATIVE_INFINITY
to Double.POSITIVE_INFINITY
for all coordinates.public final boolean getIsUndefined()
Double.NaN
.