@FunctionalInterface public static interface IndexerFunction.IntKey<V> extends IndexerFunction<Integer,V>
IndexerFunction that distinguishes and identifies elements using int keys.
It assumes that elements are fully identifiable by plain numeric identifier and treats object keys as a mere wrappers. The hash function is computed by taking int key value.
IndexerFunction.DefaultIdentityKey, IndexerFunction.DefaultIndexerFunction, IndexerFunction.IdentityKey<K,V>, IndexerFunction.IntKey<V>, IndexerFunction.LongKey<V>DEFAULT, DEFAULT_IDENTITY_KEY| Modifier and Type | Method and Description |
|---|---|
int |
getIntKey(V value)
Returns number key for specified value to be used for hashing and identification.
|
default long |
getNumberKey(V value)
Returns number key for specified value to be used for hashing and identification;
called when explicit number key is needed or when other methods delegate operations as specified.
|
default Integer |
getObjectKey(V value)
Returns object key for specified value to be used for hashing and identification;
called when explicit object key is needed or when other methods delegate operations as specified.
|
default int |
hashCodeByKey(Integer key)
Returns hash code for specified object key; called when performing operations using object keys.
|
default int |
hashCodeByValue(V value)
Returns hash code for specified value; called when performing value-based operations, including rehash.
|
default boolean |
matchesByKey(Integer key,
V value)
Determines if specified object key matches specified value; called when performing operations using object keys.
|
default boolean |
matchesByValue(V newValue,
V oldValue)
Determines if specified new value matches specified old value; called when performing value-based operations.
|
hashCodeByKey, matchesByKeyint getIntKey(V value)
default long getNumberKey(V value)
This implementation delegates to
expression.getIntKey(value)
getNumberKey in interface IndexerFunction<Integer,V>default int hashCodeByValue(V value)
This implementation delegates to
expression.hashCodeByKey(getIntKey(value))
hashCodeByValue in interface IndexerFunction<Integer,V>default boolean matchesByValue(V newValue, V oldValue)
This implementation delegates to
( expression.getIntKey(newValue) == getIntKey(oldValue))
matchesByValue in interface IndexerFunction<Integer,V>default Integer getObjectKey(V value)
This implementation delegates to
expression.getIntKey(value)
getObjectKey in interface IndexerFunction<Integer,V>default int hashCodeByKey(Integer key)
This implementation delegates to
expression.hashCodeByKey(key.intValue())
hashCodeByKey in interface IndexerFunction<Integer,V>default boolean matchesByKey(Integer key, V value)
This implementation delegates to
(key == expression.getIntKey(value))
matchesByKey in interface IndexerFunction<Integer,V>Copyright © 2002–2025 Devexperts LLC. All rights reserved.