com.activequant.utils
Class IdentityUtils

java.lang.Object
  extended by com.activequant.utils.IdentityUtils

public class IdentityUtils
extends Object

All objects have both identity (the object's location in memory) and state (the object's data).
This generic class allows the developer to easily implement identity and state comparison
for each object

History:
- [07.10.2007] Created (Erik Nijkamp)

Author:
Erik Nijkamp

Constructor Summary
IdentityUtils()
           
 
Method Summary
static boolean areEqual(boolean aThis, boolean aThat)
           
static boolean areEqual(char aThis, char aThat)
           
static boolean areEqual(double aThis, double aThat)
           
static boolean areEqual(float aThis, float aThat)
           
static boolean areEqual(long aThis, long aThat)
           
static boolean areEqual(Object aThis, Object aThat)
           
static
<T extends Comparable<T>>
boolean
equalsTo(T o1, Object o2)
           
static int safeCompare(byte o1, byte o2)
           
static int safeCompare(char o1, char o2)
           
static int safeCompare(int o1, int o2)
           
static int safeCompare(long o1, long o2)
           
static
<T extends Comparable<T>>
int
safeCompare(T o1, T o2)
           
static int safeHashCode(byte i)
           
static int safeHashCode(char i)
           
static int safeHashCode(int i)
           
static int safeHashCode(long i)
           
static
<T> int
safeHashCode(T o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityUtils

public IdentityUtils()
Method Detail

areEqual

public static boolean areEqual(boolean aThis,
                               boolean aThat)

areEqual

public static boolean areEqual(char aThis,
                               char aThat)

areEqual

public static boolean areEqual(long aThis,
                               long aThat)

areEqual

public static boolean areEqual(float aThis,
                               float aThat)

areEqual

public static boolean areEqual(double aThis,
                               double aThat)

areEqual

public static boolean areEqual(Object aThis,
                               Object aThat)

safeCompare

public static <T extends Comparable<T>> int safeCompare(T o1,
                                                        T o2)

safeCompare

public static int safeCompare(int o1,
                              int o2)

safeCompare

public static int safeCompare(long o1,
                              long o2)

safeCompare

public static int safeCompare(char o1,
                              char o2)

safeCompare

public static int safeCompare(byte o1,
                              byte o2)

safeHashCode

public static <T> int safeHashCode(T o)

safeHashCode

public static int safeHashCode(int i)

safeHashCode

public static int safeHashCode(long i)

safeHashCode

public static int safeHashCode(char i)

safeHashCode

public static int safeHashCode(byte i)

equalsTo

public static <T extends Comparable<T>> boolean equalsTo(T o1,
                                                         Object o2)


Copyright © 2012 ActiveQuant GmbH. All Rights Reserved.