Package org.jboss.remoting3._private
Interface IntIndexMap<E>
-
- Type Parameters:
E
- the element type
- All Superinterfaces:
Collection<E>
,Iterable<E>
,ToIntFunction<E>
- All Known Implementing Classes:
IntIndexHashMap
public interface IntIndexMap<E> extends Iterable<E>, ToIntFunction<E>, Collection<E>
A map which is indexed by integer value and thus acts similarly to a set.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description E
computeIfAbsent(int key, IntFunction<E> producer)
Compute a map value if no mapping exists.boolean
containsKey(int index)
Determine whether the given index is contained in the map.E
get(int index)
Get the value for the given index.E
put(E value)
Put a value into the map, replacing and returning any existing mapping.E
putIfAbsent(E value)
Put a value into the map if there is not already an existing mapping for it.boolean
remove(Object o)
E
removeKey(int index)
Remove and return a value for the given index.E
replace(E value)
Put a value into the map only if there is an existing mapping for it.boolean
replace(E oldValue, E newValue)
Replace an old value with a new value.-
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface java.util.function.ToIntFunction
applyAsInt
-
-
-
-
Method Detail
-
containsKey
boolean containsKey(int index)
Determine whether the given index is contained in the map.- Parameters:
index
- the index- Returns:
true
if it is contained in the map
-
get
E get(int index)
Get the value for the given index.- Parameters:
index
- the index- Returns:
- the corresponding value
-
removeKey
E removeKey(int index)
Remove and return a value for the given index.- Parameters:
index
- the index- Returns:
- the value
-
put
E put(E value)
Put a value into the map, replacing and returning any existing mapping.- Parameters:
value
- the value to add- Returns:
- the old value, or
null
if the old value wasnull
or was not present
-
remove
boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<E>
-
putIfAbsent
E putIfAbsent(E value)
Put a value into the map if there is not already an existing mapping for it.- Parameters:
value
- the value to add- Returns:
- the existing value, if any, or
null
if the existing value wasnull
or the value was added successfully
-
computeIfAbsent
E computeIfAbsent(int key, IntFunction<E> producer)
Compute a map value if no mapping exists.- Parameters:
key
- the keyproducer
- the producer which creates a new value- Returns:
- the existing or new value
-
replace
E replace(E value)
Put a value into the map only if there is an existing mapping for it.- Parameters:
value
- the value to store- Returns:
- the previous value (may be
null
) ornull
if there was no mapping to replace
-
-