dsto.dfc.util
Class UniqueObject

java.lang.Object
  extended by dsto.dfc.util.UniqueObject

public class UniqueObject
extends Object

A unique object that only equals itself. The hashCode () and toString () methods may optionally be delegated to a proxy 'key' object.

Version:
$Revision$

Constructor Summary
UniqueObject()
           
UniqueObject(Object key)
           
 
Method Summary
 boolean equals(Object o)
          Only true of other object is the same instance.
 int hashCode()
          Delegated to key (or superclass if no key).
 boolean keyEquals(Object o)
          Delegated to the key's equals () method.
 String toString()
          Delegated to key (or superclass if no key).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniqueObject

public UniqueObject()

UniqueObject

public UniqueObject(Object key)
Method Detail

keyEquals

public boolean keyEquals(Object o)
Delegated to the key's equals () method. Always returns false if there is no key.


equals

public boolean equals(Object o)
Only true of other object is the same instance.

Overrides:
equals in class Object

hashCode

public int hashCode()
Delegated to key (or superclass if no key).

Overrides:
hashCode in class Object

toString

public String toString()
Delegated to key (or superclass if no key).

Overrides:
toString in class Object


Copyright © 2008 Commonwealth of Australia