K - type of the keyspublic interface MapKL<K>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MapKL.Entry<K>
A map entry (key-value pair) for MapKL.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_VALUE |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all of the mappings from this map.
|
boolean |
containsKey(K key)
Returns true if this map contains a mapping for the specified key.
|
boolean |
containsValue(long value)
Returns true if this map contains one or more mappings with the specified value.
|
long |
dot(MapKL<K> map)
Computes the dot product of this map with another map.
|
Set<MapKL.Entry<K>> |
entrySet()
Returns a
Set view of the mappings contained in this map. |
boolean |
equals(Object o)
Compares the specified object with this map for equality.
|
long |
get(K key)
Returns the value to which the specified key is mapped, or throws
NoSuchElementException if this map contains no mapping for the key. |
int |
hashCode()
Returns the hash code value for this map.
|
void |
increment(K key)
Increments the key.
|
void |
increment(K key,
long value)
Increments the key by some value.
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
Set<K> |
keySet()
Returns a
Set view of the keys contained in this map. |
void |
plus(MapKL<K> map)
Adds values of keys from another map to this map.
|
long |
put(K key,
long value)
Associates the specified value with the specified key in this map.
|
void |
putAll(MapKL<? extends K> m)
Copies all of the mappings from the specified map to this map.
|
long |
remove(K key)
Removes the mapping for a key from this map if it is present.
|
int |
size()
Returns the number of key-value mappings in this map.
|
Collection<Long> |
values()
Returns a
Collection view of the values contained in this map. |
static final long DEFAULT_VALUE
int size()
boolean isEmpty()
boolean containsKey(K key)
key - key whose presence in this map is to be testedboolean containsValue(long value)
value - value whose presence in this map is to be testedlong get(K key)
NoSuchElementException if this map contains no mapping for the key.key - the key whose associated value is to be returnedNoSuchElementException - if the key is not contained in this maplong put(K key, long value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keylong remove(K key)
key - key whose mapping is to be removed from the mapvoid putAll(MapKL<? extends K> m)
m - mappings to be stored in this mapvoid clear()
Set<K> keySet()
Set view of the keys contained in this map. The set is backed by the map, so
changes to the map are reflected in the set, and vice-versa.Collection<Long> values()
Collection view of the values contained in this map. Note that this is a
inefficient operation since it triggers autoboxing of the long values, which is exactly what
this implementation is trying to avoid. Unlike a standard Java Map, values in the
backing map cannot be altered with this collection view.Set<MapKL.Entry<K>> entrySet()
Set view of the mappings contained in this map. The set is backed by the map,
so changes to the map are reflected in the set, and vice-versa.boolean equals(Object o)
int hashCode()
Object.hashCode().void plus(MapKL<K> map)
map - the other maplong dot(MapKL<K> map)
map - the other mapvoid increment(K key)
key - key to incrementvoid increment(K key, long value)
key - key to incrementvalue - increment valueCopyright © 2018. All rights reserved.