@FunctionalInterface public static interface IndexerFunction.LongKey<V> extends IndexerFunction<Long,V>
IndexerFunction that distinguishes and identifies elements using long 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 using expression.Long.hashCode(key)
IndexerFunction.DefaultIdentityKey, IndexerFunction.DefaultIndexerFunction, IndexerFunction.IdentityKey<K,V>, IndexerFunction.IntKey<V>, IndexerFunction.LongKey<V>DEFAULT, DEFAULT_IDENTITY_KEY| Modifier and Type | Method and Description |
|---|---|
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 Long |
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(Long 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(Long 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, matchesByKeylong getNumberKey(V value)
getNumberKey in interface IndexerFunction<Long,V>default int hashCodeByValue(V value)
This implementation delegates to
expression.hashCodeByKey(getNumberKey(value))
hashCodeByValue in interface IndexerFunction<Long,V>default boolean matchesByValue(V newValue, V oldValue)
This implementation delegates to
( expression.getNumberKey(newValue) == getNumberKey(oldValue))
matchesByValue in interface IndexerFunction<Long,V>default Long getObjectKey(V value)
This implementation delegates to
expression.getNumberKey(value)
getObjectKey in interface IndexerFunction<Long,V>default int hashCodeByKey(Long key)
This implementation delegates to
expression.hashCodeByKey(key.longValue())
hashCodeByKey in interface IndexerFunction<Long,V>default boolean matchesByKey(Long key, V value)
This implementation delegates to
(key == expression.getNumberKey(value))
matchesByKey in interface IndexerFunction<Long,V>Copyright © 2002–2025 Devexperts LLC. All rights reserved.