public final class NearFarScalar extends Object implements IEquatable<NearFarScalar>, ImmutableValueType
Constructor and Description |
---|
NearFarScalar()
Initializes a new instance.
|
NearFarScalar(double[] elements)
Initializes a new instance from the first four consecutive elements in the provided array.
|
NearFarScalar(double[] elements,
int startIndex)
Initializes a new instance from four consecutive elements in the provided array.
|
NearFarScalar(double nearDistance,
double nearValue,
double farDistance,
double farValue)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(NearFarScalar left,
NearFarScalar 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 |
equalsType(NearFarScalar other)
Indicates whether another instance of this type is exactly equal to this instance.
|
double |
get(int index)
|
double |
getFarDistance()
Gets the upper bound of the camera distance range.
|
double |
getFarValue()
Gets the value to use at the upper bound of the camera distance range.
|
int |
getLength()
Gets the number of elements in this set of coordinates.
|
double |
getNearDistance()
Gets the lower bound of the camera distance range.
|
double |
getNearValue()
Gets the value to use at the lower bound of the camera distance range.
|
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(NearFarScalar left,
NearFarScalar right)
Returns
true if the two instances are not exactly equal. |
String |
toString()
Returns the string representation of the value of this instance.
|
public NearFarScalar()
public NearFarScalar(double nearDistance, double nearValue, double farDistance, double farValue)
nearDistance
- The lower bound of the camera distance range.nearValue
- The value to use at the lower bound of the camera distance range.farDistance
- The upper bound of the camera distance range.farValue
- The value to use at the upper bound of the camera distance range.public NearFarScalar(@Nonnull double[] elements)
elements
- The array of coordinate values.ArgumentNullException
- The array of elements
cannot be null
.ArgumentOutOfRangeException
- An object of this type must be constructed from an array with at least four elements
.public NearFarScalar(@Nonnull double[] elements, int startIndex)
elements
- The array of coordinate values.startIndex
- The index of the first element in the array to use.ArgumentNullException
- Thrown when the array of elements
is null
.ArgumentOutOfRangeException
- Thrown when an object of this type is constructed from an array with less than four elements
.public final double getNearDistance()
public final double getNearValue()
public final double getFarDistance()
public final double getFarValue()
public final int getLength()
public final double get(int index)
index
of 0, 1, 2, and 3 corresponding to the coordinates
NearDistance
(get
), NearValue
(get
), FarDistance
(get
), FarValue
(get
).index
- The index to retrieve.index
.ArgumentOutOfRangeException
- Thrown when index
is less than 0 or greater than or equal to Length
(get
).public final boolean equalsType(@Nonnull NearFarScalar other)
equalsType
in interface IEquatable<NearFarScalar>
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.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 int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString()
public static boolean equals(@Nonnull NearFarScalar left, @Nonnull NearFarScalar 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 NearFarScalar left, @Nonnull NearFarScalar 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
.