Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.map.mutable.primitive

public Class CharShortHashMap

extends AbstractMutableShortValuesMap
implements MutableCharShortMap, Externalizable, MutableCharKeysMap
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.impl.map.mutable.primitive.MutableCharKeysMap, org.eclipse.collections.impl.map.primitive.CharKeysMap, java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.map.primitive.MutableCharShortMap, org.eclipse.collections.api.map.primitive.MutableShortValuesMap, org.eclipse.collections.api.map.primitive.ShortValuesMap, org.eclipse.collections.api.ShortIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.map.primitive.CharShortMap
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.util.Arrays, .Iterator, .NoSuchElementException, org.eclipse.collections.api.CharIterable, .LazyCharIterable, .ShortIterable, .RichIterable, org.eclipse.collections.api.block.function.primitive.CharToShortFunction, .ShortFunction, .ShortFunction0, .ShortToShortFunction, .CharShortToShortFunction, .ObjectShortToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.CharShortPredicate, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.CharProcedure, .CharShortProcedure, .ObjectIntProcedure, org.eclipse.collections.impl.SpreadFunctions, org.eclipse.collections.api.collection.primitive.MutableShortCollection, org.eclipse.collections.api.factory.primitive.CharShortMaps, .ShortCharMaps, org.eclipse.collections.api.iterator.CharIterator, .MutableCharIterator, .MutableShortIterator, org.eclipse.collections.api.map.primitive.CharShortMap, .ImmutableCharShortMap, .MutableCharShortMap, .MutableShortCharMap, org.eclipse.collections.api.set.primitive.CharSet, .ShortSet, .MutableCharSet, org.eclipse.collections.api.tuple.primitive.CharShortPair, org.eclipse.collections.impl.bag.mutable.primitive.ShortHashBag, org.eclipse.collections.impl.iterator.UnmodifiableCharIterator, org.eclipse.collections.impl.lazy.AbstractLazyIterable, org.eclipse.collections.impl.lazy.primitive.AbstractLazyCharIterable, org.eclipse.collections.impl.set.mutable.primitive.CharHashSet, org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples

This file was automatically generated from template file primitivePrimitiveHashMap.stg.
Since
3.0.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class
private class
private class
private class

Field Summary

Modifier and TypeField and Description
private static final int
private boolean
private static final int
private static final char
private static final short
private static final int
private static final int
private char[]
private int
private int
private static final char
private AbstractMutableShortValuesMap.SentinelValues
private static final long
private short[]

Constructor Summary

AccessConstructor and Description
public
public
CharShortHashMap(int initialCapacity)

public

Method Summary

Modifier and TypeMethod and Description
private void
addKeyValueAtIndex(char key, short value, int index)

public short
addToValue(char key, short toBeAdded)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.addToValue.

Increments and updates the value associated with the key, if a value exists, or sets the value to be the specified value if one does not.

protected void
allocateTable(int sizeToAllocate)

public boolean
public MutableCharShortMap
asSynchronized()

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.asSynchronized.

Returns a synchronized view of this map, delegating all operations to this map but ensuring only one caller has access to the map at a time.

public MutableCharShortMap
asUnmodifiable()

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.asUnmodifiable.

Returns an unmodifiable view of this map, delegating all read-only operations to this map and throwing an UnsupportedOperationException for all mutating operations.

public void
public void
compact()
Deprecated since 12.0 - Use trimToSize() instead

Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.

public boolean
private void
public boolean
private short
fastGetIfAbsent(char key, short ifAbsent)

public MutableShortCharMap
flipUniqueValues()

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.flipUniqueValues.

Return the ShortCharMap that is obtained by flipping the direction of this map and making the associations from value to key.

public void
public void
forEachKeyValue(CharShortProcedure procedure)

Implements org.eclipse.collections.api.map.primitive.CharShortMap.forEachKeyValue.

Iterates through each key/value pair in the map, invoking the procedure for each.

public short
get(char key)

Implements org.eclipse.collections.api.map.primitive.CharShortMap.get.

Retrieves the value associated with the key.

public short
getAndPut(char key, short putValue, short defaultValue)

Overrides default org.eclipse.collections.api.map.primitive.MutableCharShortMap.getAndPut.

Retrieves the value associated with the key if one exists; associates a putValue with the key.

protected short
private short
getForSentinel(char key, short ifAbsent)

public short
getIfAbsent(char key, short ifAbsent)

Implements org.eclipse.collections.api.map.primitive.CharShortMap.getIfAbsent.

Retrieves the value associated with the key, returning the specified default value if no such mapping exists.

public short
getIfAbsentPut(char key, short value)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.getIfAbsentPut.

Retrieves the value associated with the key if one exists; if it does not, associates a value with the key.

public short
getIfAbsentPut(char key, ShortFunction0 function)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.getIfAbsentPut.

Retrieves the value associated with the key if one exists; if it does not, invokes the supplier and associates the result with the key.

public <P> short
getIfAbsentPutWith(char key, ShortFunction<? super P> function, P parameter)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.getIfAbsentPutWith.

Retrieves the value associated with the key if one exists; if it does not, invokes the value function with the parameter and associates the result with the key.

public short
getIfAbsentPutWithKey(char key, CharToShortFunction function)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.getIfAbsentPutWithKey.

Retrieves the value associated with the key if one exists; if it does not, associates the result of invoking the value function with the key.

protected int
public short
getOrThrow(char key)

Implements org.eclipse.collections.api.map.primitive.CharShortMap.getOrThrow.

Retrieves the value associated with the key, throwing an IllegalStateException if no such mapping exists.

protected AbstractMutableShortValuesMap.SentinelValues
protected int
protected short
public int
public <V> V
injectInto(V injectedValue, ObjectShortToObjectFunction<? super V, ? extends V> function)

Implements org.eclipse.collections.api.ShortIterable.injectInto.

private static boolean
isEmptyKey(char key)

private static boolean
isNonSentinel(char key)

protected boolean
private static boolean
isRemovedKey(char key)

public MutableCharSet
keySet()

Implements org.eclipse.collections.api.map.primitive.CharShortMap.keySet.

Returns a set containing all the keys in this map.

public LazyCharIterable
keysView()

Implements org.eclipse.collections.api.map.primitive.CharShortMap.keysView.

Returns a view of the keys in this map.

public RichIterable<CharShortPair>
keyValuesView()

Implements org.eclipse.collections.api.map.primitive.CharShortMap.keyValuesView.

Returns a view of the key/value pairs in this map.

private int
mask(int spread)

private int
public static CharShortHashMap
newWithKeysValues(char key1, short value1)

public static CharShortHashMap
newWithKeysValues(char key1, short value1, char key2, short value2)

public static CharShortHashMap
newWithKeysValues(char key1, short value1, char key2, short value2, char key3, short value3)

public static CharShortHashMap
newWithKeysValues(char key1, short value1, char key2, short value2, char key3, short value3, char key4, short value4)

pack-priv int
probe(char element)

pack-priv int
probeThree(char element, int removedIndex)

pack-priv int
probeTwo(char element, int removedIndex)

public void
put(char key, short value)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.put.

Associates a value with the specified key.

public void
putAll(CharShortMap map)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.putAll.

Puts all of the key/value mappings from the specified map into this map.

private void
putForEmptySentinel(short value)

private void
putForRemovedSentinel(short value)

public void
readExternal(ObjectInput in)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

private void
rehash(int newCapacity)

private void
public CharShortHashMap
reject(CharShortPredicate predicate)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.reject.

Return a copy of this map containing only the key/value pairs that do not match the predicate.

public void
remove(char key)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.remove.

Removes the mapping associated with the key, if one exists, from the map.

public void
private void
removeKeyAtIndex(int index)

public short
removeKeyIfAbsent(char key, short value)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.removeKeyIfAbsent.

Removes the mapping associated with the key, if one exists, from the map, returning the previously associated value with the key.

public CharShortHashMap
select(CharShortPredicate predicate)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.select.

Return a copy of this map containing only the key/value pairs that match the predicate.

protected void
public MutableShortIterator
shortIterator()

Implements org.eclipse.collections.api.ShortIterable.shortIterator, org.eclipse.collections.api.map.primitive.MutableShortValuesMap.shortIterator.

Returns a primitive iterator that can be used to iterate over the ShortIterable in an imperative style.

private short
slowGetIfAbsent(char key, short ifAbsent)

private short
slowGetIfAbsentTwo(char key, short ifAbsent)

private int
pack-priv int
spreadAndMask(char element)

pack-priv int
spreadTwoAndMask(char element)

public ImmutableCharShortMap
toImmutable()

Implements org.eclipse.collections.api.map.primitive.CharShortMap.toImmutable.

Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.

public String
public boolean
public short
updateValue(char key, short initialValueIfAbsent, ShortToShortFunction function)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.updateValue.

Updates or sets the value associated with the key by applying the function to the existing value, if one exists, or to the specified initial value if one does not.

public void
public MutableShortCollection
values()

Implements org.eclipse.collections.api.map.primitive.ShortValuesMap.values.

Returns the values in this map as a separate collection.

public CharShortHashMap
withKeysValues(char key1, short value1, char key2, short value2)

public CharShortHashMap
withKeysValues(char key1, short value1, char key2, short value2, char key3, short value3)

public CharShortHashMap
withKeysValues(char key1, short value1, char key2, short value2, char key3, short value3, char key4, short value4)

public CharShortHashMap
withKeyValue(char key1, short value1)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.withKeyValue.

Associates a value with the specified key.

public CharShortHashMap
withoutAllKeys(CharIterable keys)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.withoutAllKeys.

Removes the mappings associated with all the keys, if they exist, from this map.

public CharShortHashMap
withoutKey(char key)

Implements org.eclipse.collections.api.map.primitive.MutableCharShortMap.withoutKey.

Removes the mapping associated with the key, if one exists, from this map.

public void
writeExternal(ObjectOutput out)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableShortValuesMap:
addEmptyKeyValueaddRemovedKeyValueallSatisfyanySatisfyappendStringchunkcollectcontainscontainsAllcontainsValuecountdetectIfNoneeachforEachValueisEmptymaxminnotEmptyrejectremoveEmptyKeyremoveRemovedKeyselectsizesumtoArraytoArray