public abstract class AbstractWritableLongObjMap<T> extends java.lang.Object implements WritableLongObjMap<T>
Modifier and Type | Field and Description |
---|---|
protected int |
myModCount |
EMPTY
Constructor and Description |
---|
AbstractWritableLongObjMap() |
Modifier and Type | Method and Description |
---|---|
AbstractWritableLongObjMap<T> |
add(long key,
T value)
Associates the specified value with the specified key in this map.
|
boolean |
containsKeys(LongIterable iterable) |
boolean |
equals(java.lang.Object o)
Compares the specified object with this map for equality.
|
int |
hashCode() |
boolean |
isEmpty() |
LongSet |
keySet() |
protected void |
modified() |
T |
put(long key,
T value)
Associates the specified value with the specified key in this map.
|
void |
putAll(long[] keys,
T[] values)
Puts all keys from
keys and values to this map,
replacing the values of existing keys, if such keys are present. |
void |
putAll(LongObjIterable<T> entries)
Puts all keys from the specified iterable to this map, replacing the values
of existing keys, if such keys are present.
|
void |
putAll(LongSizedIterable keys,
java.util.Collection<T> values) |
void |
putAllKeys(LongIterable keys,
java.lang.Iterable<T> values)
Puts all
keys in the map, taking as many values as needed;
when no values are available, uses default value. |
boolean |
putIfAbsent(long key,
T value)
Associates the specified value with the specified key only if the specified key has no current mapping.
|
protected abstract T |
putImpl(long key,
T value)
put element without invocation of
AbstractWritableLongIntMap#modified() |
T |
remove(long key)
Removes value for the given key.
|
boolean |
remove(long key,
T value)
Removes the entry for the key only if the key is currently mapped to the given value.
|
void |
removeAll(long... keys) |
void |
removeAll(LongIterable keys) |
protected abstract T |
removeImpl(long key)
remove element without invocation of
AbstractWritableLongIntMap#modified() |
java.lang.String |
toString() |
java.lang.StringBuilder |
toString(java.lang.StringBuilder builder) |
java.lang.String |
toTableString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
clear
containsKey, get, keysIterator, size, valuesIterator
iterator
protected abstract T putImpl(long key, T value)
AbstractWritableLongIntMap#modified()
protected abstract T removeImpl(long key)
AbstractWritableLongIntMap#modified()
public boolean isEmpty()
isEmpty
in interface LongObjMap<T>
public boolean containsKeys(LongIterable iterable)
containsKeys
in interface LongObjMap<T>
keys
.
Otherwise falsepublic LongSet keySet()
keySet
in interface LongObjMap<T>
LongSet
view of the keys contained in this map.protected void modified()
public T put(long key, T value)
WritableLongObjMap
put
in interface WritableLongObjMap<T>
key
, or
default value if there was no mapping for key
.public boolean putIfAbsent(long key, T value)
WritableLongObjMap
putIfAbsent
in interface WritableLongObjMap<T>
true
if the size of this map has changed. Otherwise false
.public AbstractWritableLongObjMap<T> add(long key, T value)
WritableLongObjMap
add
in interface WritableLongObjMap<T>
public T remove(long key)
WritableLongObjMap
remove
in interface WritableLongObjMap<T>
public boolean remove(long key, T value)
WritableLongObjMap
remove
in interface WritableLongObjMap<T>
true
if the size of this map has changed. Otherwise false
.public void putAll(LongObjIterable<T> entries)
WritableLongObjMap
putAll
in interface WritableLongObjMap<T>
public void putAll(LongSizedIterable keys, java.util.Collection<T> values)
putAll
in interface WritableLongObjMap<T>
WritableLongObjMap.putAll(long[], Object[])
public void putAll(long[] keys, T[] values)
WritableLongObjMap
keys
and values
to this map,
replacing the values of existing keys, if such keys are present.putAll
in interface WritableLongObjMap<T>
public void putAllKeys(LongIterable keys, java.lang.Iterable<T> values)
WritableLongObjMap
keys
in the map, taking as many values
as needed;
when no values are available, uses default value.
(1, 2, 3, 4), null -> ([1, 0], [2, 0], [3, 0], [4, 0])
(1, 2, 3, 4), () -> ([1, 0], [2, 0], [3, 0], [4, 0])
(1, 2, 3, 4), (1, 2) -> ([1, 1], [2, 2], [3, 0], [4, 0])
(1, 2, 3, 4), (1, 2, 3, 4) -> ([1, 1], [2, 2], [3, 3], [4, 4])
(1, 2, 3, 4), (1, 2, 3, 4, 6, 7, 8) -> ([1, 1], [2, 2], [3, 3], [4, 4])putAllKeys
in interface WritableLongObjMap<T>
public void removeAll(long... keys)
removeAll
in interface WritableLongObjMap<T>
public void removeAll(LongIterable keys)
removeAll
in interface WritableLongObjMap<T>
public java.lang.StringBuilder toString(java.lang.StringBuilder builder)
public final java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toTableString()
public boolean equals(java.lang.Object o)
LongObjMap
LongObjMap
and both objects contain exactly the same key-value pairs,
regardless of their orderequals
in interface LongObjMap<T>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface LongObjMap<T>
hashCode
in class java.lang.Object