org.openstreetmap.josm.data.osm
Class DataSet.IdHash

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.DataSet.IdHash
All Implemented Interfaces:
Hash<PrimitiveId,OsmPrimitive>
Enclosing class:
DataSet

private static class DataSet.IdHash
extends java.lang.Object
implements Hash<PrimitiveId,OsmPrimitive>


Constructor Summary
private DataSet.IdHash()
           
 
Method Summary
 boolean equals(PrimitiveId key, OsmPrimitive value)
          Compare two instances for semantic or lookup equality.
 int getHashCode(PrimitiveId k)
          Get hashcode for given instance, based on some inner state of the instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSet.IdHash

private DataSet.IdHash()
Method Detail

getHashCode

public int getHashCode(PrimitiveId k)
Description copied from interface: Hash
Get hashcode for given instance, based on some inner state of the instance. The returned hashcode should remain constant over the time, so it should be based on some instance invariant.

Specified by:
getHashCode in interface Hash<PrimitiveId,OsmPrimitive>
Parameters:
k - the object to compute hashcode for
Returns:
computed hashcode

equals

public boolean equals(PrimitiveId key,
                      OsmPrimitive value)
Description copied from interface: Hash
Compare two instances for semantic or lookup equality. For use cases where it compares different types, refer to Storage.

Specified by:
equals in interface Hash<PrimitiveId,OsmPrimitive>
Parameters:
key - the object to compare
value - the object to compare
Returns:
true if the objects are semantically equivalent, or if k uniquely identifies t in given class.


JOSM