torero.util
Class UKG
java.lang.Object
|
+--torero.util.UKG
- public class UKG
- extends Object
A Key Generator to generate unique keys for objects based on their hashCode() method.
It is used to get names for nodes in the dot representation.
It can only be used on a set of objects if their hashCode() method returns distinct
values for each object, as java's original implementation does.
- See Also:
java.lang.object
Constructor Summary |
UKG()
|
Method Summary |
static int |
DotKey(Object o)
Generates and returns a unique key for the given object o.
|
static void |
reset()
Resets the Key Generator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UKG
public UKG()
DotKey
public static int DotKey(Object o)
- Generates and returns a unique key for the given object o.
For the same (in order to its eqals method) object the same key is returned.
The key is derived from and dependent on the the hashcode method.
- Parameters:
o
- The object to get the id for.- Returns:
- a unique key for the given object.
reset
public static void reset()
- Resets the Key Generator.