V
- the value typepublic final class IntIndexHashMap<V> extends AbstractCollection<V> implements IntIndexMap<V>
Constructor and Description |
---|
IntIndexHashMap(ToIntFunction<? super V> indexer)
Construct a new instance.
|
IntIndexHashMap(ToIntFunction<? super V> indexer,
Equaller<? super V> valueEqualler)
Construct a new instance.
|
IntIndexHashMap(ToIntFunction<? super V> indexer,
Equaller<? super V> valueEqualler,
int initialCapacity,
float loadFactor)
Construct a new instance.
|
IntIndexHashMap(ToIntFunction<? super V> indexer,
float loadFactor)
Construct a new instance.
|
IntIndexHashMap(ToIntFunction<? super V> indexer,
int initialCapacity)
Construct a new instance.
|
IntIndexHashMap(ToIntFunction<? super V> indexer,
int initialCapacity,
float loadFactor)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(V v) |
int |
applyAsInt(V argument) |
void |
clear() |
V |
computeIfAbsent(int index,
IntFunction<V> producer)
Compute a map value if no mapping exists.
|
boolean |
contains(Object o) |
boolean |
containsKey(int index)
Determine whether the given index is contained in the map.
|
V |
get(int index)
Get the value for the given index.
|
Iterator<V> |
iterator() |
V |
put(V value)
Put a value into the map, replacing and returning any existing mapping.
|
V |
putIfAbsent(V value)
Put a value into the map if there is not already an existing mapping for it.
|
boolean |
remove(Object value) |
V |
removeKey(int index)
Remove and return a value for the given index.
|
V |
replace(V value)
Put a value into the map only if there is an existing mapping for it.
|
boolean |
replace(V oldValue,
V newValue)
Replace an old value with a new value.
|
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
addAll, containsAll, isEmpty, removeAll, retainAll, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream
public IntIndexHashMap(ToIntFunction<? super V> indexer, Equaller<? super V> valueEqualler, int initialCapacity, float loadFactor)
indexer
- the key indexervalueEqualler
- the value equallerinitialCapacity
- the initial capacityloadFactor
- the load factorpublic IntIndexHashMap(ToIntFunction<? super V> indexer, Equaller<? super V> valueEqualler)
indexer
- the key indexervalueEqualler
- the value equallerpublic IntIndexHashMap(ToIntFunction<? super V> indexer, int initialCapacity, float loadFactor)
indexer
- the key indexerinitialCapacity
- the initial capacityloadFactor
- the load factorpublic IntIndexHashMap(ToIntFunction<? super V> indexer, float loadFactor)
indexer
- the key indexerloadFactor
- the load factorpublic IntIndexHashMap(ToIntFunction<? super V> indexer, int initialCapacity)
indexer
- the key indexerinitialCapacity
- the initial capacitypublic IntIndexHashMap(ToIntFunction<? super V> indexer)
indexer
- the key indexerpublic V putIfAbsent(V value)
IntIndexMap
putIfAbsent
in interface IntIndexMap<V>
value
- the value to addnull
if the existing value was null
or the value was added successfullypublic V computeIfAbsent(int index, IntFunction<V> producer)
IntIndexMap
computeIfAbsent
in interface IntIndexMap<V>
index
- the keyproducer
- the producer which creates a new valuepublic V removeKey(int index)
IntIndexMap
removeKey
in interface IntIndexMap<V>
index
- the indexpublic boolean remove(Object value)
remove
in interface Collection<V>
remove
in interface IntIndexMap<V>
remove
in class AbstractCollection<V>
public boolean containsKey(int index)
IntIndexMap
containsKey
in interface IntIndexMap<V>
index
- the indextrue
if it is contained in the mappublic V get(int index)
IntIndexMap
get
in interface IntIndexMap<V>
index
- the indexpublic V put(V value)
IntIndexMap
put
in interface IntIndexMap<V>
value
- the value to addnull
if the old value was null
or was not presentpublic V replace(V value)
IntIndexMap
replace
in interface IntIndexMap<V>
value
- the value to storenull
) or null
if there was no mapping to replacepublic boolean replace(V oldValue, V newValue)
IntIndexMap
replace
in interface IntIndexMap<V>
oldValue
- the value to replacenewValue
- the value to replace withtrue
if the replacement succeeded, or false
if the old value was not present in the mappublic int applyAsInt(V argument)
applyAsInt
in interface ToIntFunction<V>
public boolean add(V v)
add
in interface Collection<V>
add
in class AbstractCollection<V>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<V>
toArray
in class AbstractCollection<V>
public Object[] toArray()
toArray
in interface Collection<V>
toArray
in class AbstractCollection<V>
public boolean contains(Object o)
contains
in interface Collection<V>
contains
in class AbstractCollection<V>
public Iterator<V> iterator()
iterator
in interface Iterable<V>
iterator
in interface Collection<V>
iterator
in class AbstractCollection<V>
public int size()
size
in interface Collection<V>
size
in class AbstractCollection<V>
public void clear()
clear
in interface Collection<V>
clear
in class AbstractCollection<V>
Copyright © 2017 JBoss by Red Hat. All rights reserved.