public class KeyedList<K,V> extends Object implements List<V>
Constructor and Description |
---|
KeyedList() |
KeyedList(List<K> keys,
List<V> content)
Create a new KeyedList.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int pos,
V o) |
boolean |
add(V o)
Caution: This method destroys the one-to-one relation between keys and content!
|
boolean |
addAll(Collection<? extends V> c)
Caution: This method destroys the one-to-one relation between keys and content!
|
boolean |
addAll(int i,
Collection<? extends V> c)
Caution: This method destroys the one-to-one relation between keys and content!
|
boolean |
addAll(KeyedList<K,V> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
V |
get(int pos) |
V |
get(Object key)
Get the object mapped to the given key.
|
K |
getKey(int i)
Returns the key a postion i
|
int |
getKey(Object key)
Return the position of the given key in the key list.
|
Iterator<K> |
getKeyIterator()
Returns an iterator for the key list
|
List<K> |
getKeys() |
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator<V> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<V> |
listIterator() |
ListIterator<V> |
listIterator(int i) |
void |
put(int pos,
K key,
V elem)
Put an element at position.
|
void |
put(K key,
V elem)
Put an element to the end of the list.
|
V |
remove(int pos) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
removeKey(Object key)
Removes the key (and associated object) from the list
|
boolean |
retainAll(Collection<?> c) |
V |
set(int i,
V o) |
void |
set(K key,
V elem)
Replace the element mapped to key with the given element.
|
int |
size() |
List<V> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
List<V> |
values()
Return the content list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public void put(K key, V elem)
key
- a keyelem
- an elementpublic void put(int pos, K key, V elem)
pos
- insert after this positionkey
- a keyelem
- an elementpublic V get(Object key)
key
- public void set(K key, V elem)
key
- elem
- public K getKey(int i)
i
- the positionpublic Iterator<K> getKeyIterator()
public int getKey(Object key)
key
- public boolean removeKey(Object key)
key
- public int size()
public void clear()
public boolean isEmpty()
public Object[] toArray()
public int lastIndexOf(Object o)
lastIndexOf
in interface List<V>
public boolean add(V o)
public boolean contains(Object o)
public boolean remove(Object o)
public boolean addAll(int i, Collection<? extends V> c)
public boolean addAll(Collection<? extends V> c)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<V>
containsAll
in interface List<V>
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public ListIterator<V> listIterator()
listIterator
in interface List<V>
public ListIterator<V> listIterator(int i)
listIterator
in interface List<V>
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.