Creates a compound hash-key from the subkeys specified in the function parameters.
Specifically, it is an object which may serve as a hash-map key identified solely by the subkeys enclosed in it, provided that the subkey objects themselves are good to be used as hash-keys (for example, all simple data types well fit to this condition).
That means the following:
Suppose we have two subkeys: subkey1
and subkey2
.
Then, any Java implementation of compound hash-keys should satisfy the following conditions:
key1 = HashKey (subkey1, subkey2);
key2 = HashKey (subkey1, subkey2);
key1.equals(key2)
true
.
Object.hashCode()
method should be implemented
so that the returned value is derived from the values of the enclosed subkeys
(at best, it may be produced from the values returned by
subkey1.hashCode()
and subkey2.hashCode()
calls).
HashKey (classElement.id, "overridden-methods")