|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfulmine.util.reference.is
public abstract class is
A utility class for performing member comparisons within implementations of
the Object.equals(Object) method. Instead of the usual
if (this.name == null)
{
if (other.name != null)
{
return false;
}
}
else
{
if (!name.equals(other.name))
{
return false;
}
}
if (this.code != other.code)
return false;
this class allows the following
return is.eq(this.name, other.name) && is.eq(this.code, other.code);
| Constructor Summary | |
|---|---|
is()
|
|
| Method Summary | |
|---|---|
static boolean |
deepEq(Object[] a1,
Object[] a2)
Performs a deep equality check for two Object[] arguments |
static boolean |
differentClass(Object candidate,
Object other)
Test if the two objects are of the same Class. |
static boolean |
eq(boolean[] a1,
boolean[] a2)
Performs an equality check for two boolean[] arguments |
static boolean |
eq(boolean b1,
boolean b2)
Performs an equality check for two boolean arguments |
static boolean |
eq(byte[] a1,
byte[] a2)
Performs an equality check for two byte[] arguments |
static boolean |
eq(byte b1,
byte b2)
Performs an equality check for two byte arguments |
static boolean |
eq(char[] a1,
char[] a2)
Performs an equality check for two char[] arguments |
static boolean |
eq(char c1,
char c2)
Performs an equality check for two char arguments |
static boolean |
eq(double[] a1,
double[] a2)
Performs an equality check for two double[] arguments |
static boolean |
eq(double d1,
double d2)
Performs an equality check for two double arguments. |
static boolean |
eq(float[] a1,
float[] a2)
Performs an equality check for two float[] arguments |
static boolean |
eq(float f1,
float f2)
Performs an equality check for two float arguments |
static boolean |
eq(int[] a1,
int[] a2)
Performs an equality check for two int[] arguments |
static boolean |
eq(int i1,
int i2)
Performs an equality check for two integer arguments |
static boolean |
eq(long[] a1,
long[] a2)
Performs an equality check for two long[] arguments |
static boolean |
eq(long l1,
long l2)
Performs an equality check for two long arguments |
static boolean |
eq(Object[] a1,
Object[] a2)
Performs an equality check for two Object[] arguments |
static boolean |
eq(Object o1,
Object o2)
Performs an equality check of two objects. |
static boolean |
eq(short[] a1,
short[] a2)
Performs an equality check for two short[] arguments |
static boolean |
eq(short s1,
short s2)
Performs an equality check for two short arguments |
static boolean |
notNull(Object o)
Checks that the argument is not null |
static boolean |
same(Object o1,
Object o2)
Performs a reference check of two objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public is()
| Method Detail |
|---|
public static boolean differentClass(Object candidate,
Object other)
Class. This assumes
the first argument is not null. Also checks if the second argument is
null.
candidate - the first objectother - the other object
false if both objects are of the same Class,
true if they are not OR the second argument is
null (in which case the classes are not equal
anyway).
public static boolean same(Object o1,
Object o2)
o1 - the first object referenceo2 - the other object reference
true if the objects references are for the same
object
public static boolean eq(Object o1,
Object o2)
null.
o1 - the first objecto2 - the other object
true if the objects are equal OR both are
null
public static boolean eq(boolean b1,
boolean b2)
boolean arguments
b1 - the first argumentb2 - the other argument
true if the arguments are equal
public static boolean eq(byte b1,
byte b2)
byte arguments
b1 - the first argumentb2 - the other argument
true if the arguments are equal
public static boolean eq(char c1,
char c2)
char arguments
c1 - the first argumentc2 - the other argument
true if the arguments are equal
public static boolean eq(short s1,
short s2)
short arguments
s1 - the first arguments2 - the other argument
true if the arguments are equal
public static boolean eq(int i1,
int i2)
integer arguments
i1 - the first argumenti2 - the other argument
true if the arguments are equal
public static boolean eq(long l1,
long l2)
long arguments
l1 - the first argumentl2 - the other argument
true if the arguments are equal
public static boolean eq(float f1,
float f2)
float arguments
f1 - the first argumentf2 - the other argument
true if the arguments are equalFloat.floatToIntBits(float)
public static boolean eq(double d1,
double d2)
double arguments.
d1 - the first argumentd2 - the other argument
true if the arguments are equalDouble.doubleToLongBits(double)
public static boolean eq(boolean[] a1,
boolean[] a2)
boolean[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(boolean[], boolean[])
public static boolean eq(byte[] a1,
byte[] a2)
byte[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(byte[], byte[])
public static boolean eq(char[] a1,
char[] a2)
char[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(char[], char[])
public static boolean eq(short[] a1,
short[] a2)
short[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(short[], short[])
public static boolean eq(int[] a1,
int[] a2)
int[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(int[], int[])
public static boolean eq(long[] a1,
long[] a2)
long[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(long[], long[])
public static boolean eq(float[] a1,
float[] a2)
float[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(float[], float[])
public static boolean eq(double[] a1,
double[] a2)
double[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(double[], double[])
public static boolean eq(Object[] a1,
Object[] a2)
Object[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.equals(Object[], Object[])
public static boolean deepEq(Object[] a1,
Object[] a2)
Object[] arguments
a1 - the first argumenta2 - the other argument
true if the arguments are equalArrays.deepEquals(Object[], Object[])public static boolean notNull(Object o)
null
o - the argument
true if the argument is not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||