Package org.codelibs.jhighlight.fastutil
Interface Hash.Strategy<K>
-
- Enclosing interface:
- Hash
public static interface Hash.Strategy<K>A generic hash strategy.Custom hash structures (e.g.,
org.codelibs.jhighlight.fastutil.objects.ObjectOpenCustomHashSet) allow to hash objects using arbitrary functions, a typical example being that of arrays. Of course, one has to compare objects for equality consistently with the chosen function. A hash strategy, thus, specifies an equality method and a hash function, with the obvious property that equal objects must have the same hash code.If your custom collection must be able to contain
null, then your strategy must be able to handlenull, too.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(K a, K b)Returns true if the given objects are equal with respect to this hash strategy.inthashCode(K o)Returns the hash code of the specified object with respect to this hash strategy.
-
-
-
Method Detail
-
hashCode
int hashCode(K o)
Returns the hash code of the specified object with respect to this hash strategy.- Parameters:
o- an object (ornull).- Returns:
- the hash code of the given object with respect to this hash strategy.
-
-