public class HashBiMap<K,V> extends AbstractBiMap<K,V> implements Externalizable
MutableBiMap which uses two hash tables as its underlying data store.| Constructor and Description |
|---|
HashBiMap() |
HashBiMap(int initialSize) |
HashBiMap(Map<K,V> map) |
| Modifier and Type | Method and Description |
|---|---|
MutableBiMap<K,V> |
asSynchronized() |
MutableBiMap<K,V> |
asUnmodifiable() |
void |
clear() |
MutableBiMap<K,V> |
clone() |
<VV> MutableBag<VV> |
collect(Function<? super V,? extends VV> function) |
<K2,V2> HashBiMap<K2,V2> |
collect(Function2<? super K,? super V,Pair<K2,V2>> function) |
MutableBooleanBag |
collectBoolean(BooleanFunction<? super V> booleanFunction) |
MutableByteBag |
collectByte(ByteFunction<? super V> byteFunction) |
MutableCharBag |
collectChar(CharFunction<? super V> charFunction) |
MutableDoubleBag |
collectDouble(DoubleFunction<? super V> doubleFunction) |
MutableFloatBag |
collectFloat(FloatFunction<? super V> floatFunction) |
<VV> MutableBag<VV> |
collectIf(Predicate<? super V> predicate,
Function<? super V,? extends VV> function) |
MutableIntBag |
collectInt(IntFunction<? super V> intFunction) |
MutableLongBag |
collectLong(LongFunction<? super V> longFunction) |
MutableShortBag |
collectShort(ShortFunction<? super V> shortFunction) |
<R> HashBiMap<K,R> |
collectValues(Function2<? super K,? super V,? extends R> function) |
<P,VV> MutableBag<VV> |
collectWith(Function2<? super V,? super P,? extends VV> function,
P parameter) |
Set<Map.Entry<K,V>> |
entrySet() |
<VV> MutableBag<VV> |
flatCollect(Function<? super V,? extends Iterable<VV>> function) |
MutableSetMultimap<V,K> |
flip() |
MutableBiMap<V,K> |
flipUniqueValues() |
V |
forcePut(K key,
V value) |
void |
forEachValue(Procedure<? super V> procedure) |
V |
getIfAbsentPut(K key,
Function0<? extends V> function) |
V |
getIfAbsentPut(K key,
V value) |
<P> V |
getIfAbsentPutWith(K key,
Function<? super P,? extends V> function,
P parameter) |
V |
getIfAbsentPutWithKey(K key,
Function<? super K,? extends V> function) |
<VV> MutableSetMultimap<VV,V> |
groupBy(Function<? super V,? extends VV> function) |
<VV> MutableSetMultimap<VV,V> |
groupByEach(Function<? super V,? extends Iterable<VV>> function) |
<VV> MutableBiMap<VV,V> |
groupByUniqueKey(Function<? super V,? extends VV> function) |
MutableBiMap<V,K> |
inverse() |
Iterator<V> |
iterator() |
Set<K> |
keySet() |
HashBiMap<K,V> |
newEmpty() |
static <K,V> HashBiMap<K,V> |
newMap() |
static <K,V> HashBiMap<K,V> |
newWithKeysValues(K key,
V value) |
static <K,V> HashBiMap<K,V> |
newWithKeysValues(K key1,
V value1,
K key2,
V value2) |
static <K,V> HashBiMap<K,V> |
newWithKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> HashBiMap<K,V> |
newWithKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
PartitionMutableSet<V> |
partition(Predicate<? super V> predicate) |
<P> PartitionMutableSet<V> |
partitionWith(Predicate2<? super V,? super P> predicate,
P parameter) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
void |
readExternal(ObjectInput in) |
MutableSet<V> |
reject(Predicate<? super V> predicate) |
HashBiMap<K,V> |
reject(Predicate2<? super K,? super V> predicate) |
<P> MutableSet<V> |
rejectWith(Predicate2<? super V,? super P> predicate,
P parameter) |
V |
remove(Object key) |
V |
removeKey(K key) |
MutableSet<V> |
select(Predicate<? super V> predicate) |
HashBiMap<K,V> |
select(Predicate2<? super K,? super V> predicate) |
<S> MutableSet<S> |
selectInstancesOf(Class<S> clazz) |
<P> MutableSet<V> |
selectWith(Predicate2<? super V,? super P> predicate,
P parameter) |
<V1> MutableObjectDoubleMap<V1> |
sumByDouble(Function<? super V,? extends V1> groupBy,
DoubleFunction<? super V> function) |
<V1> MutableObjectDoubleMap<V1> |
sumByFloat(Function<? super V,? extends V1> groupBy,
FloatFunction<? super V> function) |
<V1> MutableObjectLongMap<V1> |
sumByInt(Function<? super V,? extends V1> groupBy,
IntFunction<? super V> function) |
<V1> MutableObjectLongMap<V1> |
sumByLong(Function<? super V,? extends V1> groupBy,
LongFunction<? super V> function) |
MutableBiMap<K,V> |
tap(Procedure<? super V> procedure) |
ImmutableBiMap<K,V> |
toImmutable() |
V |
updateValue(K key,
Function0<? extends V> factory,
Function<? super V,? extends V> function) |
<P> V |
updateValueWith(K key,
Function0<? extends V> factory,
Function2<? super V,? super P,? extends V> function,
P parameter) |
Collection<V> |
values() |
MutableBiMap<K,V> |
withAllKeyValueArguments(Pair<? extends K,? extends V>... keyValuePairs) |
MutableBiMap<K,V> |
withAllKeyValues(Iterable<? extends Pair<? extends K,? extends V>> keyValues) |
HashBiMap<K,V> |
withKeysValues(K key,
V value) |
HashBiMap<K,V> |
withKeysValues(K key1,
V value1,
K key2,
V value2) |
HashBiMap<K,V> |
withKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
HashBiMap<K,V> |
withKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
MutableBiMap<K,V> |
withKeyValue(K key,
V value) |
MutableBiMap<K,V> |
withoutAllKeys(Iterable<? extends K> keys) |
MutableBiMap<K,V> |
withoutKey(K key) |
void |
writeExternal(ObjectOutput out) |
<S> MutableSet<Pair<V,S>> |
zip(Iterable<S> that)
Deprecated.
in 8.0. Use
OrderedIterable.zip(Iterable) instead. |
MutableSet<Pair<V,Integer>> |
zipWithIndex()
Deprecated.
in 8.0. Use
OrderedIterable.zipWithIndex() instead. |
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsKey, containsValue, count, countWith, detect, detect, detectIfNone, detectOptional, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, equals, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, forEachKey, forEachKeyValue, forEachWith, forEachWithIndex, get, getFirst, getIfAbsent, getIfAbsentValue, getIfAbsentWith, getLast, getOnly, getOrDefault, groupBy, groupByEach, groupByUniqueKey, hashCode, ifPresentApply, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, keysView, keyValuesView, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedList, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toString, valuesView, zip, zipWithIndexreadExternal, writeExternalaggregateBy, aggregateBy, withMap, withMapIterableadd, aggregateInPlaceBy, countBy, countByEach, countByWith, getOrDefault, putAllMapIterable, putPair, removeAllKeys, removeIfcontainsKey, containsValue, detect, detectOptional, equals, forEachKey, forEachKeyValue, get, getIfAbsent, getIfAbsentValue, getIfAbsentWith, hashCode, ifPresentApply, injectIntoKeyValue, keysView, keyValuesView, parallelStream, spliterator, stream, toString, valuesViewaggregateBy, 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, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, 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, 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, forEachWithIndexcompute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, hashCode, isEmpty, merge, putIfAbsent, remove, replace, replace, replaceAll, sizepublic static <K,V> HashBiMap<K,V> newMap()
public static <K,V> HashBiMap<K,V> newWithKeysValues(K key, V value)
public static <K,V> HashBiMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2)
public static <K,V> HashBiMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> HashBiMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public HashBiMap<K,V> withKeysValues(K key1, V value1, K key2, V value2, K key3, V value3)
public HashBiMap<K,V> withKeysValues(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public HashBiMap<K,V> newEmpty()
newEmpty in interface MutableBiMap<K,V>newEmpty in interface MutableMapIterable<K,V>public MutableBiMap<K,V> withKeyValue(K key, V value)
withKeyValue in interface MutableBiMap<K,V>withKeyValue in interface MutableMapIterable<K,V>public MutableBiMap<K,V> withAllKeyValues(Iterable<? extends Pair<? extends K,? extends V>> keyValues)
withAllKeyValues in interface MutableBiMap<K,V>withAllKeyValues in interface MutableMapIterable<K,V>public MutableBiMap<K,V> withAllKeyValueArguments(Pair<? extends K,? extends V>... keyValuePairs)
withAllKeyValueArguments in interface MutableBiMap<K,V>withAllKeyValueArguments in interface MutableMapIterable<K,V>public MutableBiMap<K,V> withoutKey(K key)
withoutKey in interface MutableBiMap<K,V>withoutKey in interface MutableMapIterable<K,V>public MutableBiMap<K,V> withoutAllKeys(Iterable<? extends K> keys)
withoutAllKeys in interface MutableBiMap<K,V>withoutAllKeys in interface MutableMapIterable<K,V>public MutableBiMap<V,K> inverse()
inverse in interface BiMap<K,V>inverse in interface MutableBiMap<K,V>public MutableSetMultimap<V,K> flip()
flip in interface BiMap<K,V>flip in interface MutableBiMap<K,V>flip in interface MapIterable<K,V>flip in interface MutableMapIterable<K,V>public MutableBiMap<V,K> flipUniqueValues()
flipUniqueValues in interface BiMap<K,V>flipUniqueValues in interface MutableBiMap<K,V>flipUniqueValues in interface MapIterable<K,V>flipUniqueValues in interface MutableMapIterable<K,V>public V put(K key,
V value)
put in interface Map<K,V>put in interface MutableBiMap<K,V>public V forcePut(K key,
V value)
forcePut in interface MutableBiMap<K,V>public void putAll(Map<? extends K,? extends V> map)
public V removeKey(K key)
removeKey in interface MutableMapIterable<K,V>public V getIfAbsentPut(K key,
V value)
getIfAbsentPut in interface MutableMapIterable<K,V>public V getIfAbsentPut(K key,
Function0<? extends V> function)
getIfAbsentPut in interface MutableMapIterable<K,V>public <P> V getIfAbsentPutWith(K key,
Function<? super P,? extends V> function,
P parameter)
getIfAbsentPutWith in interface MutableMapIterable<K,V>public V getIfAbsentPutWithKey(K key,
Function<? super K,? extends V> function)
getIfAbsentPutWithKey in interface MutableMapIterable<K,V>public V updateValue(K key,
Function0<? extends V> factory,
Function<? super V,? extends V> function)
updateValue in interface MutableMapIterable<K,V>public <P> V updateValueWith(K key,
Function0<? extends V> factory,
Function2<? super V,? super P,? extends V> function,
P parameter)
updateValueWith in interface MutableMapIterable<K,V>public Collection<V> values()
public ImmutableBiMap<K,V> toImmutable()
toImmutable in interface BiMap<K,V>toImmutable in interface MapIterable<K,V>toImmutable in interface MutableMapIterable<K,V>public MutableBiMap<K,V> asSynchronized()
asSynchronized in interface MutableBiMap<K,V>asSynchronized in interface MutableMapIterable<K,V>public MutableBiMap<K,V> asUnmodifiable()
asUnmodifiable in interface MutableBiMap<K,V>asUnmodifiable in interface MutableMapIterable<K,V>public MutableBiMap<K,V> clone()
clone in interface MutableBiMap<K,V>clone in class Objectpublic MutableBiMap<K,V> tap(Procedure<? super V> procedure)
tap in interface BiMap<K,V>tap in interface MutableBiMap<K,V>tap in interface MapIterable<K,V>tap in interface MutableMapIterable<K,V>tap in interface RichIterable<V>public HashBiMap<K,V> select(Predicate2<? super K,? super V> predicate)
select in interface BiMap<K,V>select in interface MutableBiMap<K,V>select in interface MapIterable<K,V>select in interface MutableMapIterable<K,V>public HashBiMap<K,V> reject(Predicate2<? super K,? super V> predicate)
reject in interface BiMap<K,V>reject in interface MutableBiMap<K,V>reject in interface MapIterable<K,V>reject in interface MutableMapIterable<K,V>public <K2,V2> HashBiMap<K2,V2> collect(Function2<? super K,? super V,Pair<K2,V2>> function)
collect in interface BiMap<K,V>collect in interface MutableBiMap<K,V>collect in interface MapIterable<K,V>collect in interface MutableMapIterable<K,V>public <R> HashBiMap<K,R> collectValues(Function2<? super K,? super V,? extends R> function)
collectValues in interface BiMap<K,V>collectValues in interface MutableBiMap<K,V>collectValues in interface MapIterable<K,V>collectValues in interface MutableMapIterable<K,V>public <VV> MutableBag<VV> collect(Function<? super V,? extends VV> function)
collect in interface RichIterable<V>public <P,VV> MutableBag<VV> collectWith(Function2<? super V,? super P,? extends VV> function, P parameter)
collectWith in interface RichIterable<V>public <VV> MutableBag<VV> flatCollect(Function<? super V,? extends Iterable<VV>> function)
flatCollect in interface RichIterable<V>public MutableBooleanBag collectBoolean(BooleanFunction<? super V> booleanFunction)
collectBoolean in interface RichIterable<V>public MutableByteBag collectByte(ByteFunction<? super V> byteFunction)
collectByte in interface RichIterable<V>public MutableCharBag collectChar(CharFunction<? super V> charFunction)
collectChar in interface RichIterable<V>public MutableDoubleBag collectDouble(DoubleFunction<? super V> doubleFunction)
collectDouble in interface RichIterable<V>public MutableFloatBag collectFloat(FloatFunction<? super V> floatFunction)
collectFloat in interface RichIterable<V>public MutableIntBag collectInt(IntFunction<? super V> intFunction)
collectInt in interface RichIterable<V>public MutableLongBag collectLong(LongFunction<? super V> longFunction)
collectLong in interface RichIterable<V>public MutableShortBag collectShort(ShortFunction<? super V> shortFunction)
collectShort in interface RichIterable<V>public <VV> MutableBag<VV> collectIf(Predicate<? super V> predicate, Function<? super V,? extends VV> function)
collectIf in interface RichIterable<V>@Deprecated public MutableSet<Pair<V,Integer>> zipWithIndex()
OrderedIterable.zipWithIndex() instead.zipWithIndex in interface BiMap<K,V>zipWithIndex in interface MutableBiMap<K,V>zipWithIndex in interface MutableMapIterable<K,V>zipWithIndex in interface RichIterable<V>public <VV> MutableSetMultimap<VV,V> groupBy(Function<? super V,? extends VV> function)
groupBy in interface BiMap<K,V>groupBy in interface MutableBiMap<K,V>groupBy in interface MutableMapIterable<K,V>groupBy in interface RichIterable<V>public <VV> MutableSetMultimap<VV,V> groupByEach(Function<? super V,? extends Iterable<VV>> function)
groupByEach in interface BiMap<K,V>groupByEach in interface MutableBiMap<K,V>groupByEach in interface MutableMapIterable<K,V>groupByEach in interface RichIterable<V>@Deprecated public <S> MutableSet<Pair<V,S>> zip(Iterable<S> that)
OrderedIterable.zip(Iterable) instead.zip in interface BiMap<K,V>zip in interface MutableBiMap<K,V>zip in interface MutableMapIterable<K,V>zip in interface RichIterable<V>public MutableSet<V> select(Predicate<? super V> predicate)
select in interface BiMap<K,V>select in interface MutableBiMap<K,V>select in interface MutableMapIterable<K,V>select in interface RichIterable<V>public <P> MutableSet<V> selectWith(Predicate2<? super V,? super P> predicate, P parameter)
selectWith in interface BiMap<K,V>selectWith in interface MutableBiMap<K,V>selectWith in interface MutableMapIterable<K,V>selectWith in interface RichIterable<V>public MutableSet<V> reject(Predicate<? super V> predicate)
reject in interface BiMap<K,V>reject in interface MutableBiMap<K,V>reject in interface MutableMapIterable<K,V>reject in interface RichIterable<V>public <P> MutableSet<V> rejectWith(Predicate2<? super V,? super P> predicate, P parameter)
rejectWith in interface BiMap<K,V>rejectWith in interface MutableBiMap<K,V>rejectWith in interface MutableMapIterable<K,V>rejectWith in interface RichIterable<V>public PartitionMutableSet<V> partition(Predicate<? super V> predicate)
partition in interface BiMap<K,V>partition in interface MutableBiMap<K,V>partition in interface MutableMapIterable<K,V>partition in interface RichIterable<V>public <P> PartitionMutableSet<V> partitionWith(Predicate2<? super V,? super P> predicate, P parameter)
partitionWith in interface BiMap<K,V>partitionWith in interface MutableBiMap<K,V>partitionWith in interface RichIterable<V>public void forEachValue(Procedure<? super V> procedure)
forEachValue in interface MapIterable<K,V>forEachValue in class AbstractBiMap<K,V>public <VV> MutableBiMap<VV,V> groupByUniqueKey(Function<? super V,? extends VV> function)
groupByUniqueKey in interface BiMap<K,V>groupByUniqueKey in interface MutableBiMap<K,V>groupByUniqueKey in interface MutableMapIterable<K,V>groupByUniqueKey in interface RichIterable<V>public <V1> MutableObjectLongMap<V1> sumByInt(Function<? super V,? extends V1> groupBy, IntFunction<? super V> function)
sumByInt in interface MutableMapIterable<K,V>sumByInt in interface RichIterable<V>public <V1> MutableObjectDoubleMap<V1> sumByFloat(Function<? super V,? extends V1> groupBy, FloatFunction<? super V> function)
sumByFloat in interface MutableMapIterable<K,V>sumByFloat in interface RichIterable<V>public <V1> MutableObjectLongMap<V1> sumByLong(Function<? super V,? extends V1> groupBy, LongFunction<? super V> function)
sumByLong in interface MutableMapIterable<K,V>sumByLong in interface RichIterable<V>public <V1> MutableObjectDoubleMap<V1> sumByDouble(Function<? super V,? extends V1> groupBy, DoubleFunction<? super V> function)
sumByDouble in interface MutableMapIterable<K,V>sumByDouble in interface RichIterable<V>public <S> MutableSet<S> selectInstancesOf(Class<S> clazz)
selectInstancesOf in interface BiMap<K,V>selectInstancesOf in interface MutableBiMap<K,V>selectInstancesOf in interface MutableMapIterable<K,V>selectInstancesOf in interface RichIterable<V>public void writeExternal(ObjectOutput out) throws IOException
IOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2004–2022. All rights reserved.