@NotThreadSafe public class UnifiedMap<K,V> extends AbstractMutableMap<K,V> implements Externalizable, BatchIterable<V>
The final result is a Map implementation that's leaner than java.util.HashMap and faster than Trove's THashMap. The best of both approaches unified together, and thus the name UnifiedMap.
| Constructor and Description |
|---|
UnifiedMap() |
UnifiedMap(int initialCapacity) |
UnifiedMap(int initialCapacity,
float loadFactor) |
UnifiedMap(Map<? extends K,? extends V> map) |
UnifiedMap(org.eclipse.collections.api.tuple.Pair<K,V>... pairs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate) |
<P> boolean |
allSatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate,
P parameter) |
boolean |
anySatisfy(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate) |
<P> boolean |
anySatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate,
P parameter) |
void |
batchForEach(org.eclipse.collections.api.block.procedure.Procedure<? super V> procedure,
int sectionIndex,
int sectionCount) |
void |
clear() |
UnifiedMap<K,V> |
clone() |
<E> org.eclipse.collections.api.map.MutableMap<K,V> |
collectKeysAndValues(Iterable<E> iterable,
org.eclipse.collections.api.block.function.Function<? super E,? extends K> keyFunction,
org.eclipse.collections.api.block.function.Function<? super E,? extends V> valueFunction) |
<R> org.eclipse.collections.api.map.MutableMap<K,R> |
collectValues(org.eclipse.collections.api.block.function.Function2<? super K,? super V,? extends R> function) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
V |
detect(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate) |
org.eclipse.collections.api.tuple.Pair<K,V> |
detect(org.eclipse.collections.api.block.predicate.Predicate2<? super K,? super V> predicate) |
V |
detectIfNone(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate,
org.eclipse.collections.api.block.function.Function0<? extends V> function) |
<P> V |
detectWith(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate,
P parameter) |
<P> V |
detectWithIfNone(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate,
P parameter,
org.eclipse.collections.api.block.function.Function0<? extends V> function) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object object) |
void |
forEachKey(org.eclipse.collections.api.block.procedure.Procedure<? super K> procedure) |
void |
forEachKeyValue(org.eclipse.collections.api.block.procedure.Procedure2<? super K,? super V> procedure) |
void |
forEachValue(org.eclipse.collections.api.block.procedure.Procedure<? super V> procedure) |
<P> void |
forEachWith(org.eclipse.collections.api.block.procedure.Procedure2<? super V,? super P> procedure,
P parameter) |
void |
forEachWithIndex(org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure<? super V> objectIntProcedure) |
V |
get(Object key) |
int |
getBatchCount(int batchSize) |
int |
getCollidingBuckets() |
V |
getFirst() |
V |
getIfAbsentPut(K key,
org.eclipse.collections.api.block.function.Function0<? extends V> function) |
V |
getIfAbsentPut(K key,
V value) |
<P> V |
getIfAbsentPutWith(K key,
org.eclipse.collections.api.block.function.Function<? super P,? extends V> function,
P parameter) |
int |
getMapMemoryUsedInWords()
Returns the number of JVM words that is used by this map.
|
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
org.eclipse.collections.api.map.MutableMap<K,V> |
newEmpty() |
org.eclipse.collections.api.map.MutableMap<K,V> |
newEmpty(int capacity)
Creates a new instance of the same type, using the given capacity and the default growth parameters.
|
static <K,V> UnifiedMap<K,V> |
newMap() |
static <K,V> UnifiedMap<K,V> |
newMap(int size) |
static <K,V> UnifiedMap<K,V> |
newMap(int size,
float loadFactor) |
static <K,V> UnifiedMap<K,V> |
newMap(Map<? extends K,? extends V> map) |
static <K,V> UnifiedMap<K,V> |
newMapWith(Iterable<org.eclipse.collections.api.tuple.Pair<K,V>> inputIterable) |
static <K,V> UnifiedMap<K,V> |
newMapWith(org.eclipse.collections.api.tuple.Pair<K,V>... pairs) |
static <K,V> UnifiedMap<K,V> |
newWithKeysValues(K key,
V value) |
static <K,V> UnifiedMap<K,V> |
newWithKeysValues(K key1,
V value1,
K key2,
V value2) |
static <K,V> UnifiedMap<K,V> |
newWithKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
static <K,V> UnifiedMap<K,V> |
newWithKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
boolean |
noneSatisfy(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate) |
<P> boolean |
noneSatisfyWith(org.eclipse.collections.api.block.predicate.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) |
V |
remove(Object key) |
V |
removeKey(K key) |
int |
size() |
org.eclipse.collections.api.map.ImmutableMap<K,V> |
toImmutable() |
String |
toString()
Returns a string representation of this collection.
|
V |
updateValue(K key,
org.eclipse.collections.api.block.function.Function0<? extends V> factory,
org.eclipse.collections.api.block.function.Function<? super V,? extends V> function) |
<P> V |
updateValueWith(K key,
org.eclipse.collections.api.block.function.Function0<? extends V> factory,
org.eclipse.collections.api.block.function.Function2<? super V,? super P,? extends V> function,
P parameter) |
Collection<V> |
values() |
UnifiedMap<K,V> |
withKeysValues(K key,
V value) |
UnifiedMap<K,V> |
withKeysValues(K key1,
V value1,
K key2,
V value2) |
UnifiedMap<K,V> |
withKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3) |
UnifiedMap<K,V> |
withKeysValues(K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4) |
void |
writeExternal(ObjectOutput out) |
asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, flip, groupBy, groupByEach, partition, partitionWith, reject, reject, rejectWith, select, select, selectInstancesOf, selectWith, tap, withAllKeyValueArguments, withAllKeyValues, withKeyValue, withoutAllKeys, withoutKey, zip, zipWithIndexadd, aggregateBy, aggregateInPlaceBy, collect, flipUniqueValues, getIfAbsentPutWithKey, groupByUniqueKey, iterator, keysView, keyValuesView, valuesViewasLazy, chunk, contains, each, getIfAbsent, getIfAbsentValue, getIfAbsentWith, getLast, ifPresentApply, toArray, toArrayappendString, appendString, appendString, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsAll, containsAllArguments, containsAllIterable, count, countWith, flatCollect, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, notEmpty, reject, rejectWith, select, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndexforEachaggregateBy, aggregateInPlaceBy, collect, flipUniqueValues, groupByUniqueKeyadd, getIfAbsentPutWithKeycompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllgetIfAbsent, getIfAbsentValue, getIfAbsentWith, ifPresentApply, keysView, keyValuesView, valuesViewappendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, each, flatCollect, getLast, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, notEmpty, reject, rejectWith, select, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndexforEach, iterator, spliteratorpublic UnifiedMap()
public UnifiedMap(int initialCapacity)
public UnifiedMap(int initialCapacity,
float loadFactor)
public static <K,V> UnifiedMap<K,V> newMap()
public static <K,V> UnifiedMap<K,V> newMap(int size)
public static <K,V> UnifiedMap<K,V> newMap(int size, float loadFactor)
public static <K,V> UnifiedMap<K,V> newMap(Map<? extends K,? extends V> map)
public static <K,V> UnifiedMap<K,V> newMapWith(org.eclipse.collections.api.tuple.Pair<K,V>... pairs)
public static <K,V> UnifiedMap<K,V> newMapWith(Iterable<org.eclipse.collections.api.tuple.Pair<K,V>> inputIterable)
public static <K,V> UnifiedMap<K,V> newWithKeysValues(K key, V value)
public static <K,V> UnifiedMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2)
public static <K,V> UnifiedMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3)
public static <K,V> UnifiedMap<K,V> newWithKeysValues(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public UnifiedMap<K,V> withKeysValues(K key, V value)
public UnifiedMap<K,V> withKeysValues(K key1, V value1, K key2, V value2, K key3, V value3)
public UnifiedMap<K,V> withKeysValues(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
public UnifiedMap<K,V> clone()
public org.eclipse.collections.api.map.MutableMap<K,V> newEmpty(int capacity)
AbstractMutableMapnewEmpty in class AbstractMutableMap<K,V>public V updateValue(K key, org.eclipse.collections.api.block.function.Function0<? extends V> factory, org.eclipse.collections.api.block.function.Function<? super V,? extends V> function)
updateValue in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>updateValue in class AbstractMutableMapIterable<K,V>public <P> V updateValueWith(K key, org.eclipse.collections.api.block.function.Function0<? extends V> factory, org.eclipse.collections.api.block.function.Function2<? super V,? super P,? extends V> function, P parameter)
updateValueWith in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>updateValueWith in class AbstractMutableMapIterable<K,V>public V getIfAbsentPut(K key, org.eclipse.collections.api.block.function.Function0<? extends V> function)
getIfAbsentPut in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>getIfAbsentPut in class AbstractMutableMapIterable<K,V>public V getIfAbsentPut(K key, V value)
getIfAbsentPut in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>getIfAbsentPut in class AbstractMutableMapIterable<K,V>public <P> V getIfAbsentPutWith(K key, org.eclipse.collections.api.block.function.Function<? super P,? extends V> function, P parameter)
getIfAbsentPutWith in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>getIfAbsentPutWith in class AbstractMutableMapIterable<K,V>public int getCollidingBuckets()
public int getMapMemoryUsedInWords()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public void forEachKeyValue(org.eclipse.collections.api.block.procedure.Procedure2<? super K,? super V> procedure)
public V getFirst()
getFirst in interface org.eclipse.collections.api.RichIterable<V>getFirst in class AbstractMapIterable<K,V>public <E> org.eclipse.collections.api.map.MutableMap<K,V> collectKeysAndValues(Iterable<E> iterable, org.eclipse.collections.api.block.function.Function<? super E,? extends K> keyFunction, org.eclipse.collections.api.block.function.Function<? super E,? extends V> valueFunction)
public int getBatchCount(int batchSize)
getBatchCount in interface BatchIterable<V>public void batchForEach(org.eclipse.collections.api.block.procedure.Procedure<? super V> procedure, int sectionIndex, int sectionCount)
batchForEach in interface BatchIterable<V>public void forEachKey(org.eclipse.collections.api.block.procedure.Procedure<? super K> procedure)
forEachKey in interface org.eclipse.collections.api.map.MapIterable<K,V>forEachKey in class AbstractMapIterable<K,V>public void forEachValue(org.eclipse.collections.api.block.procedure.Procedure<? super V> procedure)
forEachValue in interface org.eclipse.collections.api.map.MapIterable<K,V>forEachValue in class AbstractMapIterable<K,V>public boolean isEmpty()
public int size()
public boolean equals(Object object)
public int hashCode()
public String toString()
AbstractRichIterable
This implementation creates an empty string buffer, appends a left square bracket, and iterates over the collection appending the string representation of each element in turn. After appending each element except the last, the string ", " is appended. Finally a right bracket is appended. A string is obtained from the string buffer, and returned.
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void forEachWithIndex(org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure<? super V> objectIntProcedure)
forEachWithIndex in interface org.eclipse.collections.api.InternalIterable<V>forEachWithIndex in class AbstractMapIterable<K,V>public <P> void forEachWith(org.eclipse.collections.api.block.procedure.Procedure2<? super V,? super P> procedure, P parameter)
forEachWith in interface org.eclipse.collections.api.InternalIterable<V>forEachWith in class AbstractMapIterable<K,V>public <R> org.eclipse.collections.api.map.MutableMap<K,R> collectValues(org.eclipse.collections.api.block.function.Function2<? super K,? super V,? extends R> function)
collectValues in interface org.eclipse.collections.api.map.MapIterable<K,V>collectValues in interface org.eclipse.collections.api.map.MutableMap<K,V>collectValues in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>collectValues in interface org.eclipse.collections.api.map.UnsortedMapIterable<K,V>collectValues in class AbstractMutableMap<K,V>public org.eclipse.collections.api.tuple.Pair<K,V> detect(org.eclipse.collections.api.block.predicate.Predicate2<? super K,? super V> predicate)
public V detect(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate)
detect in interface org.eclipse.collections.api.RichIterable<V>detect in class AbstractMapIterable<K,V>public <P> V detectWith(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate, P parameter)
detectWith in interface org.eclipse.collections.api.RichIterable<V>detectWith in class AbstractMapIterable<K,V>public V detectIfNone(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate, org.eclipse.collections.api.block.function.Function0<? extends V> function)
detectIfNone in interface org.eclipse.collections.api.RichIterable<V>detectIfNone in class AbstractMapIterable<K,V>public <P> V detectWithIfNone(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate, P parameter, org.eclipse.collections.api.block.function.Function0<? extends V> function)
detectWithIfNone in interface org.eclipse.collections.api.RichIterable<V>detectWithIfNone in class AbstractMapIterable<K,V>public boolean anySatisfy(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate)
anySatisfy in interface org.eclipse.collections.api.RichIterable<V>anySatisfy in class AbstractMapIterable<K,V>public <P> boolean anySatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate, P parameter)
anySatisfyWith in interface org.eclipse.collections.api.RichIterable<V>anySatisfyWith in class AbstractMapIterable<K,V>public boolean allSatisfy(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate)
allSatisfy in interface org.eclipse.collections.api.RichIterable<V>allSatisfy in class AbstractMapIterable<K,V>public <P> boolean allSatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate, P parameter)
allSatisfyWith in interface org.eclipse.collections.api.RichIterable<V>allSatisfyWith in class AbstractMapIterable<K,V>public boolean noneSatisfy(org.eclipse.collections.api.block.predicate.Predicate<? super V> predicate)
noneSatisfy in interface org.eclipse.collections.api.RichIterable<V>noneSatisfy in class AbstractMapIterable<K,V>public <P> boolean noneSatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2<? super V,? super P> predicate, P parameter)
noneSatisfyWith in interface org.eclipse.collections.api.RichIterable<V>noneSatisfyWith in class AbstractMapIterable<K,V>public org.eclipse.collections.api.map.ImmutableMap<K,V> toImmutable()
toImmutable in interface org.eclipse.collections.api.map.MapIterable<K,V>toImmutable in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>toImmutable in interface org.eclipse.collections.api.map.UnsortedMapIterable<K,V>toImmutable in class AbstractMutableMap<K,V>Copyright © 2004–2017. All rights reserved.