Package org.eclipse.osgi.framework.util
Class ArrayMap<K,V>
java.lang.Object
org.eclipse.osgi.framework.util.ArrayMap<K,V>
- Type Parameters:
K
- The key typeV
- the value type
- All Implemented Interfaces:
Iterable<K>
,Collection<K>
Simple map when dealing with small amounts of entries. This class also
provides a Collections view of the keys
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends K> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) getKey
(int index) getKeys()
getValue
(int index) boolean
isEmpty()
iterator()
void
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
void
sort
(Comparator<K> comparator) Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
ArrayMap
public ArrayMap(int initialCapacity) -
ArrayMap
Note that the keys and values are not copied. Changes to this ArrayMap will change the values of the keys and values Lists.
-
-
Method Details
-
get
-
put
-
remove
- Specified by:
remove
in interfaceCollection<K>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<K>
-
getKeys
-
getValues
-
size
public int size()- Specified by:
size
in interfaceCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<K>
-
contains
- Specified by:
contains
in interfaceCollection<K>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<K>
-
add
- Specified by:
add
in interfaceCollection<K>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
-
addAll
- Specified by:
addAll
in interfaceCollection<K>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K>
-
getKey
-
getValue
-
sort
-