public class ConcurrentHashMapUnsafe<K,V> extends AbstractMutableMap<K,V> implements org.eclipse.collections.api.map.ConcurrentMutableMap<K,V>, Externalizable
| Constructor and Description |
|---|
ConcurrentHashMapUnsafe() |
ConcurrentHashMapUnsafe(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
org.eclipse.collections.api.map.MutableMap<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) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
int |
countEntries() |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
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) |
V |
getIfAbsent(K key,
org.eclipse.collections.api.block.function.Function0<? extends V> function) |
V |
getIfAbsentPut(K key,
org.eclipse.collections.api.block.function.Function<? super K,? extends V> factory) |
V |
getIfAbsentPut(K key,
org.eclipse.collections.api.block.function.Function0<? extends V> factory) |
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) |
<P> V |
getIfAbsentWith(K key,
org.eclipse.collections.api.block.function.Function<? super P,? extends V> function,
P parameter) |
int |
hashCode() |
<A> A |
ifPresentApply(K key,
org.eclipse.collections.api.block.function.Function<? super V,? extends A> function) |
boolean |
isEmpty() |
Iterator<V> |
iterator() |
Set<K> |
keySet() |
org.eclipse.collections.api.map.MutableMap<K,V> |
newEmpty() |
<K,V> 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> ConcurrentHashMapUnsafe<K,V> |
newMap() |
static <K,V> ConcurrentHashMapUnsafe<K,V> |
newMap(int newSize) |
static <NK,NV> ConcurrentHashMapUnsafe<NK,NV> |
newMap(Map<NK,NV> map) |
boolean |
notEmpty() |
void |
parallelForEachKeyValue(List<org.eclipse.collections.api.block.procedure.Procedure2<K,V>> blocks,
Executor executor) |
void |
parallelForEachValue(List<org.eclipse.collections.api.block.procedure.Procedure<V>> blocks,
Executor executor) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
void |
putAllInParallel(Map<K,V> map,
int chunks,
Executor executor) |
V |
putIfAbsent(K key,
V value) |
<P1,P2> V |
putIfAbsentGetIfPresent(K key,
org.eclipse.collections.api.block.function.Function2<K,V,K> keyTransformer,
org.eclipse.collections.api.block.function.Function3<P1,P2,K,V> factory,
P1 param1,
P2 param2)
It puts an object into the map based on the key.
|
void |
readExternal(ObjectInput in) |
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
removeKey(K key) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
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() |
ConcurrentHashMapUnsafe<K,V> |
withAllKeyValueArguments(org.eclipse.collections.api.tuple.Pair<? extends K,? extends V>... keyValues) |
ConcurrentHashMapUnsafe<K,V> |
withAllKeyValues(Iterable<? extends org.eclipse.collections.api.tuple.Pair<? extends K,? extends V>> keyValues) |
ConcurrentHashMapUnsafe<K,V> |
withKeyValue(K key,
V value) |
ConcurrentHashMapUnsafe<K,V> |
withoutAllKeys(Iterable<? extends K> keys) |
ConcurrentHashMapUnsafe<K,V> |
withoutKey(K key) |
void |
writeExternal(ObjectOutput out) |
asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectValues, collectWith, flatCollect, flip, groupBy, groupByEach, partition, partitionWith, reject, reject, rejectWith, select, select, selectInstancesOf, selectWith, tap, zip, zipWithIndexadd, aggregateBy, aggregateInPlaceBy, collect, detect, flipUniqueValues, getIfAbsentPutWithKey, groupByUniqueKey, keysView, keyValuesView, valuesViewallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, asLazy, chunk, contains, detect, detectIfNone, detectWith, detectWithIfNone, each, getFirst, getIfAbsentValue, getLast, noneSatisfy, noneSatisfyWith, 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, 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, zipWithIndexaggregateBy, aggregateInPlaceBy, asSynchronized, asUnmodifiable, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectValues, collectWith, flatCollect, flip, flipUniqueValues, groupBy, groupByEach, groupByUniqueKey, partition, partitionWith, reject, reject, rejectWith, select, select, selectInstancesOf, selectWith, tap, zip, zipWithIndexadd, getIfAbsentPutWithKeycompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAlldetect, getIfAbsentValue, keysView, keyValuesView, valuesViewallSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, each, flatCollect, getFirst, getLast, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, 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, spliteratorcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllpublic ConcurrentHashMapUnsafe()
public ConcurrentHashMapUnsafe(int initialCapacity)
public static <K,V> ConcurrentHashMapUnsafe<K,V> newMap()
public static <K,V> ConcurrentHashMapUnsafe<K,V> newMap(int newSize)
public V putIfAbsent(K key, V value)
putIfAbsent in interface ConcurrentMap<K,V>putIfAbsent in interface Map<K,V>public int countEntries()
public V getIfAbsentPut(K key, org.eclipse.collections.api.block.function.Function<? super K,? extends V> factory)
public V getIfAbsentPut(K key, org.eclipse.collections.api.block.function.Function0<? extends V> factory)
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 <P1,P2> V putIfAbsentGetIfPresent(K key, org.eclipse.collections.api.block.function.Function2<K,V,K> keyTransformer, org.eclipse.collections.api.block.function.Function3<P1,P2,K,V> factory, P1 param1, P2 param2)
key - The "mutable" key, which has the same identity/hashcode as the inserted key, only during this callkeyTransformer - If the record is absent, the transformer will transform the "mutable" key into an immutable copy of the key.
Note that the transformed key must have the same identity/hashcode as the original "mutable" key.factory - It creates an object, if it is not present in the map already.public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public void parallelForEachKeyValue(List<org.eclipse.collections.api.block.procedure.Procedure2<K,V>> blocks, Executor executor)
public void parallelForEachValue(List<org.eclipse.collections.api.block.procedure.Procedure<V>> blocks, Executor executor)
public int hashCode()
public boolean equals(Object o)
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 static <NK,NV> ConcurrentHashMapUnsafe<NK,NV> newMap(Map<NK,NV> map)
public ConcurrentHashMapUnsafe<K,V> withKeyValue(K key, V value)
withKeyValue in interface org.eclipse.collections.api.map.MutableMap<K,V>withKeyValue in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>withKeyValue in class AbstractMutableMap<K,V>public ConcurrentHashMapUnsafe<K,V> withAllKeyValues(Iterable<? extends org.eclipse.collections.api.tuple.Pair<? extends K,? extends V>> keyValues)
withAllKeyValues in interface org.eclipse.collections.api.map.MutableMap<K,V>withAllKeyValues in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>withAllKeyValues in class AbstractMutableMap<K,V>public ConcurrentHashMapUnsafe<K,V> withAllKeyValueArguments(org.eclipse.collections.api.tuple.Pair<? extends K,? extends V>... keyValues)
withAllKeyValueArguments in interface org.eclipse.collections.api.map.MutableMap<K,V>withAllKeyValueArguments in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>withAllKeyValueArguments in class AbstractMutableMap<K,V>public ConcurrentHashMapUnsafe<K,V> withoutKey(K key)
withoutKey in interface org.eclipse.collections.api.map.MutableMap<K,V>withoutKey in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>withoutKey in class AbstractMutableMap<K,V>public ConcurrentHashMapUnsafe<K,V> withoutAllKeys(Iterable<? extends K> keys)
withoutAllKeys in interface org.eclipse.collections.api.map.MutableMap<K,V>withoutAllKeys in interface org.eclipse.collections.api.map.MutableMapIterable<K,V>withoutAllKeys in class AbstractMutableMap<K,V>public <K,V> org.eclipse.collections.api.map.MutableMap<K,V> newEmpty(int capacity)
AbstractMutableMapnewEmpty in class AbstractMutableMap<K,V>public boolean notEmpty()
notEmpty in interface org.eclipse.collections.api.RichIterable<V>notEmpty in class AbstractRichIterable<V>public 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 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 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 forEachKeyValue(org.eclipse.collections.api.block.procedure.Procedure2<? super K,? super V> procedure)
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 <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 V getIfAbsent(K key, org.eclipse.collections.api.block.function.Function0<? extends V> function)
getIfAbsent in interface org.eclipse.collections.api.map.MapIterable<K,V>getIfAbsent in class AbstractMapIterable<K,V>public <P> V getIfAbsentWith(K key, org.eclipse.collections.api.block.function.Function<? super P,? extends V> function, P parameter)
getIfAbsentWith in interface org.eclipse.collections.api.map.MapIterable<K,V>getIfAbsentWith in class AbstractMapIterable<K,V>public <A> A ifPresentApply(K key, org.eclipse.collections.api.block.function.Function<? super V,? extends A> function)
ifPresentApply in interface org.eclipse.collections.api.map.MapIterable<K,V>ifPresentApply 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 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 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–2018. All rights reserved.