public class LongShortHashMap extends Object implements MutableLongShortMap, Externalizable
| Constructor and Description |
|---|
LongShortHashMap() |
LongShortHashMap(int initialCapacity) |
LongShortHashMap(LongShortMap map) |
| Modifier and Type | Method and Description |
|---|---|
short |
addToValue(long key,
short toBeAdded) |
boolean |
allSatisfy(ShortPredicate predicate) |
boolean |
anySatisfy(ShortPredicate predicate) |
void |
appendString(Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
LazyShortIterable |
asLazy() |
MutableLongShortMap |
asSynchronized() |
MutableLongShortMap |
asUnmodifiable() |
double |
average() |
void |
clear() |
<V> MutableCollection<V> |
collect(ShortToObjectFunction<? extends V> function) |
void |
compact()
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
|
boolean |
contains(short value) |
boolean |
containsAll(short... source) |
boolean |
containsAll(ShortIterable source) |
boolean |
containsKey(long key) |
boolean |
containsValue(short value) |
int |
count(ShortPredicate predicate) |
short |
detectIfNone(ShortPredicate predicate,
short value) |
boolean |
equals(Object obj)
Follows the same general contract as
Map.equals(Object). |
void |
forEach(ShortProcedure procedure) |
void |
forEachKey(LongProcedure procedure) |
void |
forEachKeyValue(LongShortProcedure procedure) |
void |
forEachValue(ShortProcedure procedure) |
short |
get(long key) |
short |
getIfAbsent(long key,
short ifAbsent) |
short |
getIfAbsentPut(long key,
short value) |
short |
getIfAbsentPut(long key,
ShortFunction0 function) |
<P> short |
getIfAbsentPutWith(long key,
ShortFunction<? super P> function,
P parameter) |
short |
getIfAbsentPutWithKey(long key,
LongToShortFunction function) |
short |
getOrThrow(long key) |
int |
hashCode()
Follows the same general contract as
Map.hashCode(). |
<V> V |
injectInto(V injectedValue,
ObjectShortToObjectFunction<? super V,? extends V> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
MutableLongSet |
keySet() |
LazyLongIterable |
keysView() |
RichIterable<LongShortPair> |
keyValuesView() |
String |
makeString()
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator)
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end)
Returns a string representation of this collection.
|
short |
max() |
short |
maxIfEmpty(short defaultValue) |
double |
median() |
short |
min() |
short |
minIfEmpty(short defaultValue) |
static LongShortHashMap |
newWithKeysValues(long key1,
short value1) |
static LongShortHashMap |
newWithKeysValues(long key1,
short value1,
long key2,
short value2) |
static LongShortHashMap |
newWithKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3) |
static LongShortHashMap |
newWithKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3,
long key4,
short value4) |
boolean |
noneSatisfy(ShortPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
void |
put(long key,
short value) |
void |
putAll(LongShortMap map) |
void |
readExternal(ObjectInput in) |
LongShortHashMap |
reject(LongShortPredicate predicate) |
MutableShortCollection |
reject(ShortPredicate predicate) |
void |
remove(long key) |
void |
removeKey(long key) |
short |
removeKeyIfAbsent(long key,
short value) |
LongShortHashMap |
select(LongShortPredicate predicate) |
MutableShortCollection |
select(ShortPredicate predicate) |
ShortIterator |
shortIterator() |
int |
size()
Returns the number of items in this iterable.
|
long |
sum() |
short[] |
toArray() |
MutableShortBag |
toBag() |
ImmutableLongShortMap |
toImmutable() |
MutableShortList |
toList() |
MutableShortSet |
toSet() |
short[] |
toSortedArray() |
MutableShortList |
toSortedList() |
String |
toString()
Returns a string representation of this LongShortMap.
|
short |
updateValue(long key,
short initialValueIfAbsent,
ShortToShortFunction function) |
MutableShortCollection |
values() |
LongShortHashMap |
withKeysValues(long key1,
short value1,
long key2,
short value2) |
LongShortHashMap |
withKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3) |
LongShortHashMap |
withKeysValues(long key1,
short value1,
long key2,
short value2,
long key3,
short value3,
long key4,
short value4) |
LongShortHashMap |
withKeyValue(long key1,
short value1) |
LongShortHashMap |
withoutAllKeys(LongIterable keys) |
LongShortHashMap |
withoutKey(long key) |
void |
writeExternal(ObjectOutput out) |
public LongShortHashMap()
public LongShortHashMap(int initialCapacity)
public LongShortHashMap(LongShortMap map)
public static LongShortHashMap newWithKeysValues(long key1, short value1)
public static LongShortHashMap newWithKeysValues(long key1, short value1, long key2, short value2)
public static LongShortHashMap newWithKeysValues(long key1, short value1, long key2, short value2, long key3, short value3)
public static LongShortHashMap newWithKeysValues(long key1, short value1, long key2, short value2, long key3, short value3, long key4, short value4)
public boolean equals(Object obj)
LongShortMapMap.equals(Object).equals in interface LongShortMapequals in class Objectpublic int hashCode()
LongShortMapMap.hashCode().hashCode in interface LongShortMaphashCode in class Objectpublic String toString()
LongShortMaptoString in interface LongShortMaptoString in interface PrimitiveIterabletoString in class Objectpublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic String makeString()
PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface PrimitiveIterablepublic String makeString(String separator)
PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
PrimitiveIterablemakeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic ShortIterator shortIterator()
shortIterator in interface ShortIterablepublic short[] toArray()
toArray in interface ShortIterablepublic boolean contains(short value)
contains in interface ShortIterablepublic boolean containsAll(short... source)
containsAll in interface ShortIterablepublic boolean containsAll(ShortIterable source)
containsAll in interface ShortIterablepublic void forEach(ShortProcedure procedure)
forEach in interface ShortIterablepublic MutableShortCollection select(ShortPredicate predicate)
select in interface MutableLongShortMapselect in interface ShortIterablepublic MutableShortCollection reject(ShortPredicate predicate)
reject in interface MutableLongShortMapreject in interface ShortIterablepublic <V> MutableCollection<V> collect(ShortToObjectFunction<? extends V> function)
collect in interface MutableLongShortMapcollect in interface ShortIterablepublic short detectIfNone(ShortPredicate predicate, short value)
detectIfNone in interface ShortIterablepublic int count(ShortPredicate predicate)
count in interface ShortIterablepublic boolean anySatisfy(ShortPredicate predicate)
anySatisfy in interface ShortIterablepublic boolean allSatisfy(ShortPredicate predicate)
allSatisfy in interface ShortIterablepublic boolean noneSatisfy(ShortPredicate predicate)
noneSatisfy in interface ShortIterablepublic <V> V injectInto(V injectedValue,
ObjectShortToObjectFunction<? super V,? extends V> function)
injectInto in interface ShortIterablepublic MutableShortList toList()
toList in interface ShortIterablepublic MutableShortSet toSet()
toSet in interface ShortIterablepublic MutableShortBag toBag()
toBag in interface ShortIterablepublic LazyShortIterable asLazy()
asLazy in interface ShortIterablepublic void clear()
clear in interface MutableLongShortMappublic void put(long key,
short value)
put in interface MutableLongShortMappublic void putAll(LongShortMap map)
putAll in interface MutableLongShortMappublic void removeKey(long key)
removeKey in interface MutableLongShortMappublic void remove(long key)
remove in interface MutableLongShortMappublic short removeKeyIfAbsent(long key,
short value)
removeKeyIfAbsent in interface MutableLongShortMappublic short getIfAbsentPut(long key,
short value)
getIfAbsentPut in interface MutableLongShortMappublic short getIfAbsentPut(long key,
ShortFunction0 function)
getIfAbsentPut in interface MutableLongShortMappublic <P> short getIfAbsentPutWith(long key,
ShortFunction<? super P> function,
P parameter)
getIfAbsentPutWith in interface MutableLongShortMappublic short getIfAbsentPutWithKey(long key,
LongToShortFunction function)
getIfAbsentPutWithKey in interface MutableLongShortMappublic short addToValue(long key,
short toBeAdded)
addToValue in interface MutableLongShortMappublic short updateValue(long key,
short initialValueIfAbsent,
ShortToShortFunction function)
updateValue in interface MutableLongShortMappublic LongShortHashMap withKeyValue(long key1, short value1)
withKeyValue in interface MutableLongShortMappublic LongShortHashMap withKeysValues(long key1, short value1, long key2, short value2)
public LongShortHashMap withKeysValues(long key1, short value1, long key2, short value2, long key3, short value3)
public LongShortHashMap withKeysValues(long key1, short value1, long key2, short value2, long key3, short value3, long key4, short value4)
public LongShortHashMap withoutKey(long key)
withoutKey in interface MutableLongShortMappublic LongShortHashMap withoutAllKeys(LongIterable keys)
withoutAllKeys in interface MutableLongShortMappublic MutableLongShortMap asUnmodifiable()
asUnmodifiable in interface MutableLongShortMappublic MutableLongShortMap asSynchronized()
asSynchronized in interface MutableLongShortMappublic ImmutableLongShortMap toImmutable()
toImmutable in interface LongShortMappublic short get(long key)
get in interface LongShortMappublic short getIfAbsent(long key,
short ifAbsent)
getIfAbsent in interface LongShortMappublic short getOrThrow(long key)
getOrThrow in interface LongShortMappublic boolean containsKey(long key)
containsKey in interface LongShortMappublic boolean containsValue(short value)
containsValue in interface LongShortMappublic void forEachValue(ShortProcedure procedure)
forEachValue in interface LongShortMappublic void forEachKey(LongProcedure procedure)
forEachKey in interface LongShortMappublic void forEachKeyValue(LongShortProcedure procedure)
forEachKeyValue in interface LongShortMappublic LazyLongIterable keysView()
keysView in interface LongShortMappublic RichIterable<LongShortPair> keyValuesView()
keyValuesView in interface LongShortMappublic LongShortHashMap select(LongShortPredicate predicate)
select in interface LongShortMapselect in interface MutableLongShortMappublic LongShortHashMap reject(LongShortPredicate predicate)
reject in interface LongShortMapreject in interface MutableLongShortMappublic long sum()
sum in interface ShortIterablepublic short max()
max in interface ShortIterablepublic short maxIfEmpty(short defaultValue)
maxIfEmpty in interface ShortIterablepublic short min()
min in interface ShortIterablepublic short minIfEmpty(short defaultValue)
minIfEmpty in interface ShortIterablepublic double average()
average in interface ShortIterablepublic double median()
median in interface ShortIterablepublic short[] toSortedArray()
toSortedArray in interface ShortIterablepublic MutableShortList toSortedList()
toSortedList in interface ShortIterablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void compact()
public MutableLongSet keySet()
keySet in interface LongShortMappublic MutableShortCollection values()
values in interface LongShortMapCopyright © 2004–2017. All rights reserved.