@Immutable public interface ImmutableBiMap<K,V> extends BiMap<K,V>, ImmutableMap<K,V>
BiMap
whose contents cannot be altered after initialization.Modifier and Type | Method and Description |
---|---|
<K2,V2> ImmutableBiMap<K2,V2> |
collect(Function2<? super K,? super V,Pair<K2,V2>> function)
For each key and value of the map the function is evaluated.
|
<R> ImmutableBiMap<K,R> |
collectValues(Function2<? super K,? super V,? extends R> function)
For each key and value of the map the function is evaluated.
|
ImmutableBiMap<V,K> |
flipUniqueValues()
Return the MapIterable that is obtained by flipping the direction of this map and making the associations
from value to key.
|
ImmutableBiMap<V,K> |
inverse()
Returns an inversed view of this BiMap, where the associations are in the direction of this bimap’s values to keys.
|
ImmutableBiMap<K,V> |
reject(Predicate2<? super K,? super V> predicate)
For each key and value of the map the predicate is evaluated, if the result of the evaluation is false,
that key and value are returned in a new map.
|
ImmutableBiMap<K,V> |
select(Predicate2<? super K,? super V> predicate)
For each key and value of the map the predicate is evaluated, if the result of the evaluation is true,
that key and value are returned in a new map.
|
toImmutable
aggregateBy, aggregateInPlaceBy, castToMap, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, flatCollect, flip, groupBy, groupByEach, groupByUniqueKey, newWithAllKeyValueArguments, newWithAllKeyValues, newWithKeyValue, newWithoutAllKeys, newWithoutKey, partition, partitionWith, reject, select, selectInstancesOf, toMap, zip, zipWithIndex
toImmutable
containsKey, containsValue, detect, equals, forEachKey, forEachKeyValue, forEachValue, get, getIfAbsent, getIfAbsentValue, getIfAbsentWith, hashCode, ifPresentApply, keysView, keyValuesView, toString, valuesView
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, flatCollect, getFirst, getLast, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, rejectWith, select, selectWith, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndex
forEach, forEachWith, forEachWithIndex
forEach, iterator, spliterator
ImmutableBiMap<V,K> inverse()
BiMap
ImmutableBiMap<K,V> select(Predicate2<? super K,? super V> predicate)
MapIterable
e.g. peopleByCity.select(new Predicate2<City, Person>() { public boolean accept(City city, Person person) { return city.getName().equals("Anytown") && person.getLastName().equals("Smith"); } });
<R> ImmutableBiMap<K,R> collectValues(Function2<? super K,? super V,? extends R> function)
MapIterable
e.g. peopleByCity.collectValues(new Function2<City, Person, String>() { public String value(City city, Person person) { return person.getFirstName() + " " + person.getLastName(); } });
collectValues
in interface BiMap<K,V>
collectValues
in interface ImmutableMap<K,V>
collectValues
in interface MapIterable<K,V>
collectValues
in interface UnsortedMapIterable<K,V>
<K2,V2> ImmutableBiMap<K2,V2> collect(Function2<? super K,? super V,Pair<K2,V2>> function)
MapIterable
e.g. peopleByCity.collect(new Function2<City, Person, String>() { public String value(City city, Person person) { return Pair.of(city.getCountry(), person.getAddress().getCity()); } });
ImmutableBiMap<K,V> reject(Predicate2<? super K,? super V> predicate)
MapIterable
e.g. peopleByCity.reject(new Predicate2<City, Person>() { public boolean accept(City city, Person person) { return city.getName().equals("Anytown") && person.getLastName().equals("Smith"); } });
ImmutableBiMap<V,K> flipUniqueValues()
MapIterable
MapIterablemap = this.newMapWithKeysValues(1, "1", 2, "2", 3, "3"); MapIterable result = map.flipUniqueValues(); Assert.assertTrue(result.equals(UnifiedMap.newWithKeysValues("1", 1, "2", 2, "3", 3)));
flipUniqueValues
in interface ImmutableMap<K,V>
flipUniqueValues
in interface MapIterable<K,V>
Copyright © 2004–2019. All rights reserved.