Package org.yamcs.utils
Class IndexedList<K,V>
- java.lang.Object
-
- org.yamcs.utils.IndexedList<K,V>
-
-
Constructor Summary
Constructors Constructor Description IndexedList()
IndexedList(int size)
IndexedList(IndexedList<K,V> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(K key, V value)
void
changeKey(K oldKey, K newKey)
V
get(int idx)
V
get(K key)
Returns the value mapped to the key or null if there is no such elementint
getIndex(K key)
returns the index of the element with key or -1 if there is no such elementList<V>
getList()
boolean
hasKey(K key)
Iterator<V>
iterator()
void
set(int idx, V value)
int
size()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
IndexedList
public IndexedList()
-
IndexedList
public IndexedList(IndexedList<K,V> list)
-
IndexedList
public IndexedList(int size)
-
-
Method Detail
-
getIndex
public int getIndex(K key)
returns the index of the element with key or -1 if there is no such element- Parameters:
key
-- Returns:
- returns the index of the element with key or -1 if there is no such element
-
hasKey
public boolean hasKey(K key)
- Parameters:
key
-- Returns:
- true if the list contains the key
-
get
public V get(K key)
Returns the value mapped to the key or null if there is no such element- Parameters:
key
-- Returns:
-
get
public V get(int idx)
- Parameters:
idx
-- Returns:
- See Also:
List.get(int)
-
size
public int size()
- Returns:
- returns the size of the list.
-
set
public void set(int idx, V value)
-
-