messif.objects
Class LocalAbstractObject.DataEqualObject

java.lang.Object
  extended by messif.objects.LocalAbstractObject.DataEqualObject
Enclosing class:
LocalAbstractObject

public static class LocalAbstractObject.DataEqualObject
extends java.lang.Object

A wrapper class that allows to hash/equal abstract objects using their data and not ID. Especially, standard hashing structures (HashMap, etc.) can be used on wrapped object.


Field Summary
protected  LocalAbstractObject object
          Encapsulated object
 
Constructor Summary
LocalAbstractObject.DataEqualObject(LocalAbstractObject object)
          Creates a new instance of DataEqualObject wrapper over the specified LocalAbstractObject.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object has the same data as this one.
 LocalAbstractObject get()
          Returns the encapsulated object.
 int hashCode()
          Returns a hash code value for the object data.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

protected final LocalAbstractObject object
Encapsulated object

Constructor Detail

LocalAbstractObject.DataEqualObject

public LocalAbstractObject.DataEqualObject(LocalAbstractObject object)
Creates a new instance of DataEqualObject wrapper over the specified LocalAbstractObject.

Parameters:
object - the encapsulated object
Method Detail

get

public LocalAbstractObject get()
Returns the encapsulated object.

Returns:
the encapsulated object

hashCode

public int hashCode()
Returns a hash code value for the object data.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for the data of this object

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object has the same data as this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.