public interface CharObjectMap<V> extends PrimitiveObjectMap<V>
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(char key)
Returns whether or not the key is present in the map.
|
ObjectCharMap<V> |
flipUniqueValues()
Return the ObjectCharMap that is obtained by flipping the direction of this map and making the associations
from value to key.
|
void |
forEachKey(CharProcedure procedure)
Iterates through each key in the map, invoking the procedure for each.
|
void |
forEachKeyValue(CharObjectProcedure<? super V> procedure)
Iterates through each key/value pair in the map, invoking the procedure for each.
|
V |
get(char key)
Retrieves the value associated with the key.
|
V |
getIfAbsent(char key,
Function0<? extends V> ifAbsent)
Retrieves the value associated with the key if one exists; if it does not,
returns the result of invoking the value supplier.
|
default <IV> IV |
injectIntoKeyValue(IV injectedValue,
ObjectCharObjectToObjectFunction<? super IV,? super V,? extends IV> function)
Implements the injectInto pattern with each key/value pair of the map.
|
MutableCharSet |
keySet()
Returns a set containing all the keys in this map.
|
LazyCharIterable |
keysView()
Returns a view of the keys in this map.
|
RichIterable<CharObjectPair<V>> |
keyValuesView()
Returns a view of the key/value pairs in this map.
|
CharObjectMap<V> |
reject(CharObjectPredicate<? super V> predicate)
Return a copy of this map containing only the key/value pairs that do not match the
predicate.
|
CharObjectMap<V> |
select(CharObjectPredicate<? super V> predicate)
Return a copy of this map containing only the key/value pairs that match the predicate.
|
CharObjectMap<V> |
tap(Procedure<? super V> procedure)
Executes the Procedure for each element in the iterable and returns
this. |
ImmutableCharObjectMap<V> |
toImmutable()
Returns a copy of this map that is immutable (if this map is mutable) or
itself if it is already immutable.
|
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsValue, equals, flatCollect, flatCollectWith, forEachValue, groupBy, groupByEach, groupByUniqueKey, hashCode, parallelStream, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, spliterator, stream, toString, values, zip, zipWithIndexaggregateBy, aggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countBy, countByEach, countByEach, countByWith, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, sumByDouble, sumByFloat, sumByInt, sumByLong, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndexforEach, forEachWith, forEachWithIndexV get(char key)
null is returned.key - the keyV getIfAbsent(char key, Function0<? extends V> ifAbsent)
key - the keyfunction - the supplier that provides the value if no mapping exists for keyifAbsent if notboolean containsKey(char key)
key - the keyCharObjectMap<V> tap(Procedure<? super V> procedure)
RichIterablethis.
Example using a Java 8 lambda expression:
RichIterable<Person> tapped =
people.tap(person -> LOGGER.info(person.getName()));
Example using an anonymous inner class:
RichIterable<Person> tapped =
people.tap(new Procedure<Person>()
{
public void value(Person person)
{
LOGGER.info(person.getName());
}
});
tap in interface RichIterable<V>RichIterable.each(Procedure),
RichIterable.forEach(Procedure)void forEachKey(CharProcedure procedure)
procedure - the procedure to invoke for each keyvoid forEachKeyValue(CharObjectProcedure<? super V> procedure)
procedure - the procedure to invoke for each key/value pairdefault <IV> IV injectIntoKeyValue(IV injectedValue,
ObjectCharObjectToObjectFunction<? super IV,? super V,? extends IV> function)
value - to be injected into the mapfunction - to apply to the injected value and key/value pairsCharObjectMap<V> select(CharObjectPredicate<? super V> predicate)
predicate - the predicate to determine which key/value pairs in this map should be
included in the returned mapCharObjectMap<V> reject(CharObjectPredicate<? super V> predicate)
predicate - the predicate to determine which key/value pairs in this map should be
excluded from the returned mapImmutableCharObjectMap<V> toImmutable()
MutableCharSet keySet()
LazyCharIterable keysView()
RichIterable<CharObjectPair<V>> keyValuesView()
ObjectCharMap<V> flipUniqueValues()
IllegalStateException - if the ObjectCharMap contains duplicate values.Copyright © 2004–2022. All rights reserved.