public class Arrays extends Object
Constructor and Description |
---|
Arrays() |
Modifier and Type | Method and Description |
---|---|
static boolean |
deepEquals(Object[] a1,
Object[] a2,
double epsilon)
Returns
true if the two specified arrays are deeply
equal to one another with a tolerable error. |
static boolean |
equals(double[] a,
double[] a2,
double epsilon)
Returns
true if the two specified arrays of doubles are
equal to one another with a tolerable error. |
static boolean |
equals(float[] a,
float[] a2,
double epsilon)
Returns
true if the two specified arrays of floats are
equal to one another with a tolerable error. |
static boolean |
equals(Object[] a,
Object[] a2,
double epsilon)
Returns
true if the two specified arrays of Objects are
equal to one another with a tolerable error. |
public static boolean equals(double[] a, double[] a2, double epsilon)
true
if the two specified arrays of doubles are
equal to one another with a tolerable error. Two arrays are
considered equal if both arrays contain the same number of elements, and
all corresponding pairs of elements in the two arrays are equal with a
tolerable error. In other words, two arrays are equal if they contain the
same elements with a tolerable error in the same order. Also, two array
references are considered equal if both are null
.a
- one array to be tested for equalitya2
- the other array to be tested for equalityepsilon
- the tolerable errortrue
if the two arrays are equal with a tolerable
errorpublic static boolean equals(float[] a, float[] a2, double epsilon)
true
if the two specified arrays of floats are
equal to one another with a tolerable error. Two arrays are
considered equal if both arrays contain the same number of elements, and
all corresponding pairs of elements in the two arrays are equal with a
tolerable error. In other words, two arrays are equal if they contain the
same elements with a tolerable error in the same order. Also, two array
references are considered equal if both are null
.a
- one array to be tested for equalitya2
- the other array to be tested for equalityepsilon
- the tolerable errortrue
if the two arrays are equal with a tolerable
errorpublic static boolean equals(Object[] a, Object[] a2, double epsilon)
true
if the two specified arrays of Objects are
equal to one another with a tolerable error. The two arrays are
considered equal if both arrays contain the same number of elements, and
all corresponding pairs of elements in the two arrays are equal with a
tolerable. In other words, the two arrays are equal if they contain the
same elements with a tolerable error in the same order. Also, two array
references are considered equal if both are null
.a
- one array to be tested for equalitya2
- the other array to be tested for equalityepsilon
- the tolerable errortrue
if the two arrays are equal with a tolerable errorpublic static boolean deepEquals(Object[] a1, Object[] a2, double epsilon)
true
if the two specified arrays are deeply
equal to one another with a tolerable error. Unlike the
equals(Object[],Object[], double)
method, this method is
appropriate for use with nested arrays of arbitrary depth.
Two array references are considered deeply equal if both
are null
, or if they refer to arrays that contain the same
number of elements and all corresponding pairs of elements in the two
arrays are deeply equal with a tolerable error.
If either of the specified arrays contain themselves as elements either directly or indirectly through one or more levels of arrays, the behavior of this method is undefined.
a1
- one array to be tested for equalitya2
- the other array to be tested for equalityepsilon
- the tolerable errortrue
if the two arrays are equal with a tolerable errorCopyright (C) 2015-2017 The Helenus Driver Project Authors.