Package org.openstreetmap.josm.data.osm
Class Storage.PrimitiveIdHash
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.Storage.PrimitiveIdHash
-
- All Implemented Interfaces:
Hash<PrimitiveId,PrimitiveId>
public static class Storage.PrimitiveIdHash extends java.lang.Object implements Hash<PrimitiveId,PrimitiveId>
Hash forPrimitiveId.
-
-
Constructor Summary
Constructors Constructor Description PrimitiveIdHash()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(PrimitiveId key, PrimitiveId value)Compare two instances for semantic or lookup equality.intgetHashCode(PrimitiveId k)Get hashcode for given instance, based on some inner state of the instance.
-
-
-
Constructor Detail
-
PrimitiveIdHash
public PrimitiveIdHash()
-
-
Method Detail
-
getHashCode
public int getHashCode(PrimitiveId k)
Description copied from interface:HashGet 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:
getHashCodein interfaceHash<PrimitiveId,PrimitiveId>- Parameters:
k- the object to compute hashcode for- Returns:
- computed hashcode
-
equals
public boolean equals(PrimitiveId key, PrimitiveId value)
Description copied from interface:HashCompare two instances for semantic or lookup equality. For use cases where it compares different types, refer toStorage.- Specified by:
equalsin interfaceHash<PrimitiveId,PrimitiveId>- Parameters:
key- the object to comparevalue- the object to compare- Returns:
- true if the objects are semantically equivalent, or if k uniquely identifies t in given class.
-
-