Class HashBiMap<K,V>
java.lang.Object
org.eclipse.collections.impl.bimap.AbstractBiMap<K,V>
org.eclipse.collections.impl.bimap.mutable.HashBiMap<K,V>
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,Iterable<V>,Map<K,,V> BiMap<K,,V> MutableBiMap<K,,V> InternalIterable<V>,MapIterable<K,,V> MutableMapIterable<K,,V> RichIterable<V>
A
MutableBiMap which uses two hash tables as its underlying data store.- Since:
- 4.2
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()clone()<VV> MutableBag<VV><K2,V2> HashBiMap<K2, V2> collectBoolean(BooleanFunction<? super V> booleanFunction) collectByte(ByteFunction<? super V> byteFunction) collectChar(CharFunction<? super V> charFunction) collectDouble(DoubleFunction<? super V> doubleFunction) collectFloat(FloatFunction<? super V> floatFunction) <VV> MutableBag<VV>collectInt(IntFunction<? super V> intFunction) <R> MutableBiMap<R,V> collectKeysUnique(Function2<? super K, ? super V, ? extends R> function) collectLong(LongFunction<? super V> longFunction) collectShort(ShortFunction<? super V> shortFunction) collectValues(Function2<? super K, ? super V, ? extends R> function) <P,VV> MutableBag<VV> collectWith(Function2<? super V, ? super P, ? extends VV> function, P parameter) entrySet()<VV> MutableBag<VV>flatCollect(Function<? super V, ? extends Iterable<VV>> function) flip()voidforEachValue(Procedure<? super V> procedure) getIfAbsentPut(K key, Function0<? extends V> function) getIfAbsentPut(K key, V value) <P> VgetIfAbsentPutWith(K key, Function<? super P, ? extends V> function, P parameter) getIfAbsentPutWithKey(K key, Function<? super K, ? extends V> function) <VV> MutableSetMultimap<VV,V> <VV> MutableSetMultimap<VV,V> groupByEach(Function<? super V, ? extends Iterable<VV>> function) <VV> MutableBiMap<VV,V> groupByUniqueKey(Function<? super V, ? extends VV> function) inverse()iterator()keySet()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) <P> PartitionMutableSet<V>partitionWith(Predicate2<? super V, ? super P> predicate, P parameter) voidvoidreject(Predicate2<? super K, ? super V> predicate) <P> MutableSet<V>rejectWith(Predicate2<? super V, ? super P> predicate, P parameter) 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) <P> VupdateValueWith(K key, Function0<? extends V> factory, Function2<? super V, ? super P, ? extends V> function, P parameter) values()withAllKeyValueArguments(Pair<? extends K, ? extends V>... keyValuePairs) withAllKeyValues(Iterable<? extends Pair<? extends K, ? extends V>> keyValues) withKeysValues(K key, V value) withKeysValues(K key1, V value1, K key2, V value2) withKeyValue(K key, V value) withoutAllKeys(Iterable<? extends K> keys) withoutKey(K key) void<S> MutableSet<Pair<V,S>> Deprecated.in 8.0.Deprecated.in 8.0.Methods inherited from class org.eclipse.collections.impl.bimap.AbstractBiMap
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, zipWithIndexMethods inherited from interface java.io.Externalizable
readExternal, writeExternalMethods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndexMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, get, hashCode, isEmpty, merge, putIfAbsent, remove, replace, replace, replaceAll, sizeMethods inherited from interface org.eclipse.collections.api.map.MapIterable
containsKey, containsValue, detect, detectOptional, equals, forEachKey, forEachKeyValue, get, getIfAbsent, getIfAbsentValue, getIfAbsentWith, hashCode, ifPresentApply, injectIntoKeyValue, keysView, keyValuesView, parallelStream, spliterator, stream, toString, valuesViewMethods inherited from interface org.eclipse.collections.api.bimap.MutableBiMap
aggregateBy, aggregateBy, reduceBy, withMap, withMapIterableMethods inherited from interface org.eclipse.collections.api.map.MutableMapIterable
add, aggregateInPlaceBy, countBy, countByEach, countByWith, forEach, getOrDefault, putAllMapIterable, putPair, removeAllKeys, removeIfMethods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, 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, reduceBy, 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, zipWithIndex
-
Constructor Details
-
HashBiMap
public HashBiMap() -
HashBiMap
public HashBiMap(int initialSize) -
HashBiMap
-
-
Method Details
-
newMap
-
newWithKeysValues
-
newWithKeysValues
-
newWithKeysValues
public static <K,V> HashBiMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3) -
newWithKeysValues
public static <K,V> HashBiMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) -
withKeysValues
-
withKeysValues
-
withKeysValues
-
withKeysValues
-
newEmpty
- Specified by:
newEmptyin interfaceMutableBiMap<K,V> - Specified by:
newEmptyin interfaceMutableMapIterable<K,V>
-
withKeyValue
- Specified by:
withKeyValuein interfaceMutableBiMap<K,V> - Specified by:
withKeyValuein interfaceMutableMapIterable<K,V>
-
withAllKeyValues
public MutableBiMap<K,V> withAllKeyValues(Iterable<? extends Pair<? extends K, ? extends V>> keyValues) - Specified by:
withAllKeyValuesin interfaceMutableBiMap<K,V> - Specified by:
withAllKeyValuesin interfaceMutableMapIterable<K,V>
-
withAllKeyValueArguments
- Specified by:
withAllKeyValueArgumentsin interfaceMutableBiMap<K,V> - Specified by:
withAllKeyValueArgumentsin interfaceMutableMapIterable<K,V>
-
withoutKey
- Specified by:
withoutKeyin interfaceMutableBiMap<K,V> - Specified by:
withoutKeyin interfaceMutableMapIterable<K,V>
-
withoutAllKeys
- Specified by:
withoutAllKeysin interfaceMutableBiMap<K,V> - Specified by:
withoutAllKeysin interfaceMutableMapIterable<K,V>
-
inverse
- Specified by:
inversein interfaceBiMap<K,V> - Specified by:
inversein interfaceMutableBiMap<K,V>
-
flip
- Specified by:
flipin interfaceBiMap<K,V> - Specified by:
flipin interfaceMapIterable<K,V> - Specified by:
flipin interfaceMutableBiMap<K,V> - Specified by:
flipin interfaceMutableMapIterable<K,V>
-
flipUniqueValues
- Specified by:
flipUniqueValuesin interfaceBiMap<K,V> - Specified by:
flipUniqueValuesin interfaceMapIterable<K,V> - Specified by:
flipUniqueValuesin interfaceMutableBiMap<K,V> - Specified by:
flipUniqueValuesin interfaceMutableMapIterable<K,V>
-
put
- Specified by:
putin interfaceMap<K,V> - Specified by:
putin interfaceMutableBiMap<K,V>
-
forcePut
- Specified by:
forcePutin interfaceMutableBiMap<K,V>
-
putAll
-
remove
-
removeKey
- Specified by:
removeKeyin interfaceMutableMapIterable<K,V>
-
clear
public void clear() -
getIfAbsentPut
- Specified by:
getIfAbsentPutin interfaceMutableMapIterable<K,V>
-
getIfAbsentPut
- Specified by:
getIfAbsentPutin interfaceMutableMapIterable<K,V>
-
getIfAbsentPutWith
- Specified by:
getIfAbsentPutWithin interfaceMutableMapIterable<K,V>
-
getIfAbsentPutWithKey
- Specified by:
getIfAbsentPutWithKeyin interfaceMutableMapIterable<K,V>
-
updateValue
public V updateValue(K key, Function0<? extends V> factory, Function<? super V, ? extends V> function) - Specified by:
updateValuein interfaceMutableMapIterable<K,V>
-
updateValueWith
public <P> V updateValueWith(K key, Function0<? extends V> factory, Function2<? super V, ? super P, ? extends V> function, P parameter) - Specified by:
updateValueWithin interfaceMutableMapIterable<K,V>
-
keySet
-
values
-
entrySet
-
iterator
-
toImmutable
- Specified by:
toImmutablein interfaceBiMap<K,V> - Specified by:
toImmutablein interfaceMapIterable<K,V> - Specified by:
toImmutablein interfaceMutableMapIterable<K,V>
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableBiMap<K,V> - Specified by:
asSynchronizedin interfaceMutableMapIterable<K,V>
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableBiMap<K,V> - Specified by:
asUnmodifiablein interfaceMutableMapIterable<K,V>
-
clone
- Specified by:
clonein interfaceMutableBiMap<K,V>
-
tap
- Specified by:
tapin interfaceBiMap<K,V> - Specified by:
tapin interfaceMapIterable<K,V> - Specified by:
tapin interfaceMutableBiMap<K,V> - Specified by:
tapin interfaceMutableMapIterable<K,V> - Specified by:
tapin interfaceRichIterable<K>
-
select
- Specified by:
selectin interfaceBiMap<K,V> - Specified by:
selectin interfaceMapIterable<K,V> - Specified by:
selectin interfaceMutableBiMap<K,V> - Specified by:
selectin interfaceMutableMapIterable<K,V>
-
reject
- Specified by:
rejectin interfaceBiMap<K,V> - Specified by:
rejectin interfaceMapIterable<K,V> - Specified by:
rejectin interfaceMutableBiMap<K,V> - Specified by:
rejectin interfaceMutableMapIterable<K,V>
-
collect
- Specified by:
collectin interfaceBiMap<K,V> - Specified by:
collectin interfaceMapIterable<K,V> - Specified by:
collectin interfaceMutableBiMap<K,V> - Specified by:
collectin interfaceMutableMapIterable<K,V>
-
collectValues
- Specified by:
collectValuesin interfaceBiMap<K,V> - Specified by:
collectValuesin interfaceMapIterable<K,V> - Specified by:
collectValuesin interfaceMutableBiMap<K,V> - Specified by:
collectValuesin interfaceMutableMapIterable<K,V>
-
collectKeysUnique
- Specified by:
collectKeysUniquein interfaceBiMap<K,V> - Specified by:
collectKeysUniquein interfaceMapIterable<K,V> - Specified by:
collectKeysUniquein interfaceMutableBiMap<K,V> - Specified by:
collectKeysUniquein interfaceMutableMapIterable<K,V>
-
collect
- Specified by:
collectin interfaceRichIterable<K>
-
collectWith
public <P,VV> MutableBag<VV> collectWith(Function2<? super V, ? super P, ? extends VV> function, P parameter) - Specified by:
collectWithin interfaceRichIterable<K>
-
flatCollect
- Specified by:
flatCollectin interfaceRichIterable<K>
-
collectBoolean
- Specified by:
collectBooleanin interfaceRichIterable<K>
-
collectByte
- Specified by:
collectBytein interfaceRichIterable<K>
-
collectChar
- Specified by:
collectCharin interfaceRichIterable<K>
-
collectDouble
- Specified by:
collectDoublein interfaceRichIterable<K>
-
collectFloat
- Specified by:
collectFloatin interfaceRichIterable<K>
-
collectInt
- Specified by:
collectIntin interfaceRichIterable<K>
-
collectLong
- Specified by:
collectLongin interfaceRichIterable<K>
-
collectShort
- Specified by:
collectShortin interfaceRichIterable<K>
-
collectIf
public <VV> MutableBag<VV> collectIf(Predicate<? super V> predicate, Function<? super V, ? extends VV> function) - Specified by:
collectIfin interfaceRichIterable<K>
-
zipWithIndex
Deprecated.in 8.0. UseOrderedIterable.zipWithIndex()instead.- Specified by:
zipWithIndexin interfaceBiMap<K,V> - Specified by:
zipWithIndexin interfaceMutableBiMap<K,V> - Specified by:
zipWithIndexin interfaceMutableMapIterable<K,V> - Specified by:
zipWithIndexin interfaceRichIterable<K>
-
groupBy
- Specified by:
groupByin interfaceBiMap<K,V> - Specified by:
groupByin interfaceMutableBiMap<K,V> - Specified by:
groupByin interfaceMutableMapIterable<K,V> - Specified by:
groupByin interfaceRichIterable<K>
-
groupByEach
public <VV> MutableSetMultimap<VV,V> groupByEach(Function<? super V, ? extends Iterable<VV>> function) - Specified by:
groupByEachin interfaceBiMap<K,V> - Specified by:
groupByEachin interfaceMutableBiMap<K,V> - Specified by:
groupByEachin interfaceMutableMapIterable<K,V> - Specified by:
groupByEachin interfaceRichIterable<K>
-
zip
Deprecated.in 8.0. UseOrderedIterable.zip(Iterable)instead.- Specified by:
zipin interfaceBiMap<K,V> - Specified by:
zipin interfaceMutableBiMap<K,V> - Specified by:
zipin interfaceMutableMapIterable<K,V> - Specified by:
zipin interfaceRichIterable<K>
-
select
- Specified by:
selectin interfaceBiMap<K,V> - Specified by:
selectin interfaceMutableBiMap<K,V> - Specified by:
selectin interfaceMutableMapIterable<K,V> - Specified by:
selectin interfaceRichIterable<K>
-
selectWith
- Specified by:
selectWithin interfaceBiMap<K,V> - Specified by:
selectWithin interfaceMutableBiMap<K,V> - Specified by:
selectWithin interfaceMutableMapIterable<K,V> - Specified by:
selectWithin interfaceRichIterable<K>
-
reject
- Specified by:
rejectin interfaceBiMap<K,V> - Specified by:
rejectin interfaceMutableBiMap<K,V> - Specified by:
rejectin interfaceMutableMapIterable<K,V> - Specified by:
rejectin interfaceRichIterable<K>
-
rejectWith
- Specified by:
rejectWithin interfaceBiMap<K,V> - Specified by:
rejectWithin interfaceMutableBiMap<K,V> - Specified by:
rejectWithin interfaceMutableMapIterable<K,V> - Specified by:
rejectWithin interfaceRichIterable<K>
-
partition
- Specified by:
partitionin interfaceBiMap<K,V> - Specified by:
partitionin interfaceMutableBiMap<K,V> - Specified by:
partitionin interfaceMutableMapIterable<K,V> - Specified by:
partitionin interfaceRichIterable<K>
-
partitionWith
public <P> PartitionMutableSet<V> partitionWith(Predicate2<? super V, ? super P> predicate, P parameter) - Specified by:
partitionWithin interfaceBiMap<K,V> - Specified by:
partitionWithin interfaceMutableBiMap<K,V> - Specified by:
partitionWithin interfaceRichIterable<K>
-
forEachValue
- Specified by:
forEachValuein interfaceMapIterable<K,V> - Overrides:
forEachValuein classAbstractBiMap<K,V>
-
groupByUniqueKey
- Specified by:
groupByUniqueKeyin interfaceBiMap<K,V> - Specified by:
groupByUniqueKeyin interfaceMutableBiMap<K,V> - Specified by:
groupByUniqueKeyin interfaceMutableMapIterable<K,V> - Specified by:
groupByUniqueKeyin interfaceRichIterable<K>
-
sumByInt
public <V1> MutableObjectLongMap<V1> sumByInt(Function<? super V, ? extends V1> groupBy, IntFunction<? super V> function) - Specified by:
sumByIntin interfaceMutableMapIterable<K,V> - Specified by:
sumByIntin interfaceRichIterable<K>
-
sumByFloat
public <V1> MutableObjectDoubleMap<V1> sumByFloat(Function<? super V, ? extends V1> groupBy, FloatFunction<? super V> function) - Specified by:
sumByFloatin interfaceMutableMapIterable<K,V> - Specified by:
sumByFloatin interfaceRichIterable<K>
-
sumByLong
public <V1> MutableObjectLongMap<V1> sumByLong(Function<? super V, ? extends V1> groupBy, LongFunction<? super V> function) - Specified by:
sumByLongin interfaceMutableMapIterable<K,V> - Specified by:
sumByLongin interfaceRichIterable<K>
-
sumByDouble
public <V1> MutableObjectDoubleMap<V1> sumByDouble(Function<? super V, ? extends V1> groupBy, DoubleFunction<? super V> function) - Specified by:
sumByDoublein interfaceMutableMapIterable<K,V> - Specified by:
sumByDoublein interfaceRichIterable<K>
-
selectInstancesOf
- Specified by:
selectInstancesOfin interfaceBiMap<K,V> - Specified by:
selectInstancesOfin interfaceMutableBiMap<K,V> - Specified by:
selectInstancesOfin interfaceMutableMapIterable<K,V> - Specified by:
selectInstancesOfin interfaceRichIterable<K>
-
writeExternal
- Throws:
IOException
-
readExternal
- Throws:
IOExceptionClassNotFoundException
-