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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends K> c) voidclear()booleanbooleancontainsAll(Collection<?> c) getKey(int index) getKeys()getValue(int index) booleanisEmpty()iterator()voidbooleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()voidsort(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, waitMethods 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:
removein interfaceCollection<K>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<K>
-
getKeys
-
getValues
-
size
public int size()- Specified by:
sizein interfaceCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<K>
-
contains
- Specified by:
containsin interfaceCollection<K>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<K>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<K>
-
add
- Specified by:
addin interfaceCollection<K>
-
containsAll
- Specified by:
containsAllin interfaceCollection<K>
-
addAll
- Specified by:
addAllin interfaceCollection<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<K>
-
retainAll
- Specified by:
retainAllin interfaceCollection<K>
-
getKey
-
getValue
-
sort
-