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 voidadd(K key, V value)voidchangeKey(K oldKey, K newKey)Vget(int idx)Vget(K key)Returns the value mapped to the key or null if there is no such elementintgetIndex(K key)returns the index of the element with key or -1 if there is no such elementList<V>getList()booleanhasKey(K key)Iterator<V>iterator()voidset(int idx, V value)intsize()StringtoString()-
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:
-
size
public int size()
- Returns:
- returns the size of the list.
-
set
public void set(int idx, V value)
-
-