public interface ObjObjMap<K,V> extends Map<K,V>, Container
Map
interface.ObjObjMapFactory
,
@KolobokeMap
Modifier and Type | Method and Description |
---|---|
ObjObjCursor<K,V> |
cursor()
Returns a new cursor over the entries of this map.
|
ObjSet<Map.Entry<K,V>> |
entrySet() |
boolean |
forEachWhile(BiPredicate<? super K,? super V> predicate)
Checks the given
predicate on each entry in this map until all entries
have been processed or the predicate returns false for some entry,
or throws an Exception . |
Equivalence<K> |
keyEquivalence()
Returns the equivalence strategy for keys in this map.
|
ObjSet<K> |
keySet() |
boolean |
removeIf(BiPredicate<? super K,? super V> filter)
Removes all of the entries of this collection that satisfy the given predicate.
|
Equivalence<V> |
valueEquivalence()
Returns the equivalence strategy for values in this map.
|
ObjCollection<V> |
values() |
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
clear, ensureCapacity, isEmpty, shrink, size, sizeAsLong
@Nonnull Equivalence<K> keyEquivalence()
Map
interface which defined in terms of Object.equals(Object)
equality of key objects
(almost all methods, actually), are supposed to use this equivalence instead.HashObjObjMapFactory.withKeyEquivalence(com.koloboke.collect.Equivalence<? super K>)
@Nonnull Equivalence<V> valueEquivalence()
Map
interface which defined in terms of Object.equals(Object)
equality of value objects,
for example, Map.containsValue(Object)
and Map.remove(Object, Object)
,
are supposed to use this equivalence instead.ObjObjMapFactory.withValueEquivalence(com.koloboke.collect.Equivalence<? super V>)
boolean forEachWhile(@Nonnull BiPredicate<? super K,? super V> predicate)
predicate
on each entry in this map until all entries
have been processed or the predicate returns false
for some entry,
or throws an Exception
. Exceptions thrown by the predicate are relayed to the caller.
The entries will be processed in the same order as the entry set iterator unless that order is unspecified in which case implementations may use an order which differs from the entry set iterator.
If the map is empty, this method returns true
immediately.
predicate
- the predicate to be checked for each entrytrue
if the predicate returned true
for all entries of the map,
false
if it returned false
for the entry@Nonnull ObjObjCursor<K,V> cursor()
Basic cursor usage idiom is:
for (ObjObjCursor<K, V> cur = map.cursor(); cur.moveNext();) {
// Work with cur.key() and cur.value()
// Call cur.remove() to remove the current entry
}
boolean removeIf(@Nonnull BiPredicate<? super K,? super V> filter)
filter
- a predicate which returns true
for elements to be removedtrue
if any elements were removedNullPointerException
- if the specified filter is nullUnsupportedOperationException
- if elements cannot be removed from this collection.
Implementations may throw this exception if a matching element cannot be removed
or if, in general, removal is not supported.