Interface ObjectBooleanMap<K>
- All Superinterfaces:
BooleanIterable
,PrimitiveIterable
- All Known Subinterfaces:
ImmutableObjectBooleanMap<K>
,MutableObjectBooleanMap<K>
- All Known Implementing Classes:
AbstractImmutableObjectBooleanMap
,ObjectBooleanHashMap
,ObjectBooleanHashMapWithHashingStrategy
,SynchronizedObjectBooleanMap
,UnmodifiableObjectBooleanMap
public interface ObjectBooleanMap<K> extends BooleanIterable
This file was automatically generated from template file objectPrimitiveMap.stg.
- Since:
- 3.0.
-
Method Summary
Modifier and Type Method Description boolean
containsKey(Object key)
Returns whether or not the key is present in the map.boolean
containsValue(boolean value)
Returns whether or not this map contains the value.void
forEachKey(Procedure<? super K> procedure)
Iterates through each key in the map, invoking the procedure for each.void
forEachKeyValue(ObjectBooleanProcedure<? super K> procedure)
Iterates through each key/value pair in the map, invoking the procedure for each.void
forEachValue(BooleanProcedure procedure)
Iterates through each value in this map.boolean
get(Object key)
Retrieves the value associated with the key.boolean
getIfAbsent(Object key, boolean ifAbsent)
Retrieves the value associated with the key, returning the specified default value if no such mapping exists.boolean
getOrThrow(Object key)
Retrieves the value associated with the key, throwing anIllegalStateException
if no such mapping exists.Set<K>
keySet()
Returns a set containing all the keys in this map.LazyIterable<K>
keysView()
Returns a view of the keys in this map.RichIterable<ObjectBooleanPair<K>>
keyValuesView()
Returns a view of the key/value pairs in this map.ObjectBooleanMap<K>
reject(ObjectBooleanPredicate<? super K> predicate)
Return a copy of this map containing only the key/value pairs that do not match the predicate.ObjectBooleanMap<K>
select(ObjectBooleanPredicate<? super K> predicate)
Return a copy of this map containing only the key/value pairs that match the predicate.default ObjectBooleanMap<K>
tap(BooleanProcedure procedure)
ImmutableObjectBooleanMap<K>
toImmutable()
Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.String
toString()
Follows the same general contract asAbstractMap.toString()
MutableBooleanCollection
values()
Returns the values in this map as a separate collection.Methods inherited from interface org.eclipse.collections.api.BooleanIterable
allSatisfy, anySatisfy, asLazy, booleanIterator, chunk, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, noneSatisfy, reduce, reduceIfEmpty, reject, reject, select, select, toArray, toArray, toBag, toList, toSet
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
-
Method Details
-
get
Retrieves the value associated with the key. If no mapping exists for the key, the default value (usually0
) is returned.- Parameters:
key
- the key- Returns:
- the value associated with the key, or the default value if no such mapping exists
-
getOrThrow
Retrieves the value associated with the key, throwing anIllegalStateException
if no such mapping exists.- Parameters:
key
- the key- Returns:
- the value associated with the key
- Throws:
IllegalStateException
- if no mapping exists for the key
-
getIfAbsent
Retrieves the value associated with the key, returning the specified default value if no such mapping exists.- Parameters:
key
- the keyifAbsent
- the default value to return if no mapping exists forkey
- Returns:
- the value associated with the key, or
ifAbsent
if no such mapping exists.
-
containsKey
Returns whether or not the key is present in the map.- Parameters:
key
- the key- Returns:
- if a mapping exists in this map for the key
-
containsValue
boolean containsValue(boolean value)Returns whether or not this map contains the value.- Parameters:
value
- the value to test- Returns:
- if this collection contains the value
-
forEachValue
Iterates through each value in this map.- Parameters:
procedure
- the procedure to invoke for each value in this map.
-
forEachKey
Iterates through each key in the map, invoking the procedure for each.- Parameters:
procedure
- the procedure to invoke for each key
-
forEachKeyValue
Iterates through each key/value pair in the map, invoking the procedure for each.- Parameters:
procedure
- the procedure to invoke for each key/value pair
-
select
Return a copy of this map containing only the key/value pairs that match the predicate.- Parameters:
predicate
- the predicate to determine which key/value pairs in this map should be included in the returned map- Returns:
- a copy of this map with the matching key/value pairs
-
reject
Return a copy of this map containing only the key/value pairs that do not match the predicate.- Parameters:
predicate
- the predicate to determine which key/value pairs in this map should be excluded from the returned map- Returns:
- a copy of this map without the matching key/value pairs
-
tap
- Specified by:
tap
in interfaceBooleanIterable
- Since:
- 9.0.
-
toString
String toString()Follows the same general contract asAbstractMap.toString()
- Specified by:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classObject
- Returns:
- a string representation of this ObjectBooleanMap
- See Also:
AbstractCollection.toString()
-
toImmutable
ImmutableObjectBooleanMap<K> toImmutable()Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.- Returns:
- an immutable map that is equivalent to this one
-
keySet
Returns a set containing all the keys in this map. The set is backed by the map, so any modifications to the returned set will affect this map.- Returns:
- a mutable set containing the keys in this map
-
values
MutableBooleanCollection values()Returns the values in this map as a separate collection. The returned collection is backed by the map, so any changes made to the returned collection will affect the state of this map.- Returns:
- the values as a collection backed by this map
-
keysView
LazyIterable<K> keysView()Returns a view of the keys in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the keys returned by the iterable.- Returns:
- a view of the keys in this map
- Since:
- 5.0
-
keyValuesView
RichIterable<ObjectBooleanPair<K>> keyValuesView()Returns a view of the key/value pairs in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the pairs returned by the iterable.- Returns:
- a view of the keys in this map
- Since:
- 5.0
-