proper.imp
Class Fingerprint

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.imp.Fingerprint
All Implemented Interfaces:
java.lang.Comparable, ProperInterface

public class Fingerprint
extends ProperObject
implements java.lang.Comparable

This class handles Fingerprints, i.e. comparing them and also taking care of NULLs.

Version:
$Revision: 1.2 $
Author:
FracPete

Field Summary
static java.lang.String DATE
           
static java.lang.String DOUBLE
           
static java.lang.String INTEGER
           
static java.lang.String LIST
           
static java.lang.String LONG
           
static java.lang.String NULL
           
static java.lang.String PREDICATE
           
static java.lang.String SQL_DATE
           
static java.lang.String STRING
           
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
Fingerprint(java.lang.Object value)
          initializes the object
 
Method Summary
 int compareTo(java.lang.Object o)
          compares the given object with itself
 boolean equals(java.lang.Object obj)
          checks whether the fingerprint is the same
 java.lang.String getSuperClass(Fingerprint fp)
          returns the smallest class with which this and the given object can be described
static java.lang.String getSuperClass(Fingerprint fp1, Fingerprint fp2)
          returns the smallest class with which both objects can be described.
 java.lang.String getSuperClass(java.lang.Object o)
          returns the smallest class with which this and the given object can be described
static java.lang.String getSuperClass(java.lang.Object o1, java.lang.Object o2)
          returns the smallest class with which both objects can be described.
 java.lang.Object getValue()
          returns the stored value
 boolean isNull()
          checks whether the stored value depicts a NULL value
static boolean isNull(java.lang.Object value)
          checks whether the given value depicts a NULL value
static void main(java.lang.String[] args)
          for testing only
 java.lang.String toString()
          returns the class name of the value
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STRING

public static final java.lang.String STRING
See Also:
Constant Field Values

INTEGER

public static final java.lang.String INTEGER
See Also:
Constant Field Values

LONG

public static final java.lang.String LONG
See Also:
Constant Field Values

DOUBLE

public static final java.lang.String DOUBLE
See Also:
Constant Field Values

DATE

public static final java.lang.String DATE
See Also:
Constant Field Values

SQL_DATE

public static final java.lang.String SQL_DATE
See Also:
Constant Field Values

LIST

public static final java.lang.String LIST
See Also:
Constant Field Values

PREDICATE

public static final java.lang.String PREDICATE
See Also:
Constant Field Values

NULL

public static final java.lang.String NULL
See Also:
Constant Field Values
Constructor Detail

Fingerprint

public Fingerprint(java.lang.Object value)
initializes the object

Parameters:
value - the object to get the fingerprint from
Method Detail

getValue

public java.lang.Object getValue()
returns the stored value


isNull

public boolean isNull()
checks whether the stored value depicts a NULL value


isNull

public static boolean isNull(java.lang.Object value)
checks whether the given value depicts a NULL value


compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
compares the given object with itself

Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

equals

public boolean equals(java.lang.Object obj)
checks whether the fingerprint is the same

Overrides:
equals in class java.lang.Object

getSuperClass

public java.lang.String getSuperClass(java.lang.Object o)
returns the smallest class with which this and the given object can be described

See Also:
getSuperClass(Object, Object)

getSuperClass

public java.lang.String getSuperClass(Fingerprint fp)
returns the smallest class with which this and the given object can be described

See Also:
getSuperClass(Object, Object)

getSuperClass

public static java.lang.String getSuperClass(Fingerprint fp1,
                                             Fingerprint fp2)
returns the smallest class with which both objects can be described. E.g. for Integer and Double it is Double, or for Double and Double it is Double, but for Integer and Date it is String.


getSuperClass

public static java.lang.String getSuperClass(java.lang.Object o1,
                                             java.lang.Object o2)
returns the smallest class with which both objects can be described. E.g. for Integer and Double it is Double, or for Double and Double it is Double, but for Integer and Date it is String.


toString

public java.lang.String toString()
returns the class name of the value

Overrides:
toString in class ProperObject

main

public static void main(java.lang.String[] args)
for testing only