public class KeyedList<K,V>
extends java.lang.Object
implements java.util.List<V>
Constructor and Description |
---|
KeyedList() |
KeyedList(java.util.List<K> keys,
java.util.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(java.util.Collection<? extends V> c)
Caution: This method destroys the one-to-one relation between keys and content!
|
boolean |
addAll(int i,
java.util.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(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
V |
get(int pos) |
V |
get(java.lang.Object key)
Get the object mapped to the given key.
|
K |
getKey(int i)
Returns the key a postion i
|
int |
getKey(java.lang.Object key)
Return the position of the given key in the key list.
|
java.util.Iterator<K> |
getKeyIterator()
Returns an iterator for the key list
|
java.util.List<K> |
getKeys() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
java.util.Iterator<V> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<V> |
listIterator() |
java.util.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(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c)
Caution: This method destroys the one-to-one relation between keys and content!
|
boolean |
removeKey(java.lang.Object key)
Removes the key (and associated object) from the list
|
boolean |
retainAll(java.util.Collection<?> c)
Caution: This method destroys the one-to-one relation between keys and content!
|
V |
set(int i,
V o) |
void |
set(K key,
V elem)
Replace the element mapped to key with the given element.
|
int |
size() |
java.util.List<V> |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.util.List<V> |
values()
Return the content list.
|
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(java.lang.Object key)
key
- public void set(K key, V elem)
key
- elem
- public java.util.List<V> values()
public K getKey(int i)
i
- the positionpublic java.util.Iterator<K> getKeyIterator()
public java.util.List<K> getKeys()
public int getKey(java.lang.Object key)
key
- public boolean removeKey(java.lang.Object key)
key
- public int size()
public void clear()
public boolean isEmpty()
public java.lang.Object[] toArray()
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<V>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<V>
public boolean add(V o)
public boolean contains(java.lang.Object o)
public boolean remove(java.lang.Object o)
public boolean addAll(int i, java.util.Collection<? extends V> c)
addAll
in interface java.util.List<V>
public boolean addAll(java.util.Collection<? extends V> c)
public boolean containsAll(java.util.Collection<?> c)
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public java.util.Iterator<V> iterator()
public java.util.List<V> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<V>
public java.util.ListIterator<V> listIterator()
listIterator
in interface java.util.List<V>
public java.util.ListIterator<V> listIterator(int i)
listIterator
in interface java.util.List<V>
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.