public class CaseInsensitiveListTreeMap<V>
extends TreeMap<String,V>
Constructor and Description |
---|
CaseInsensitiveListTreeMap()
Instantiates a new empty CaseInsensitiveListTreeMap.
|
CaseInsensitiveListTreeMap(int size)
Instantiates a new CaseInsensitiveListTreeMap.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(V value)
Associates the specified value with the map.size + 1 in this map and add value to the end of the list.
|
void |
clear() |
List<V> |
createList()
Creates the list.
|
List<V> |
createList(int size)
Creates the list of the specific size.
|
V |
get(int index)
Returns the element at the specified position in the list.
|
List<V> |
getList()
Gets the list.
|
int |
indexOf(V value)
Returns the index of the first occurrence of the specified element
in this list, or -1 if this list does not contain the element.
|
V |
put(String key,
V value)
Associates the specified value with the specified key in this map
and adds value to the end of the list.
|
V |
put(String key,
V value,
int index)
Associates the specified value with the specified key in this map
and adds value to the list at the specified index.
|
V |
putKey(String key,
V value)
Associates the specified value with the specified key in this map
and adds key to the end of the list.
|
V |
remove(Object key)
Removes the mapping for a key from this map and from the list if it is present.
|
V |
set(String key,
V value,
boolean replace)
If value associated with the key doesn't (or equal to null) associates the specified value
with the specified key in this map and adds value to the end of the list.
|
ceilingEntry, ceilingKey, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, putAll, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
public CaseInsensitiveListTreeMap()
public CaseInsensitiveListTreeMap(int size)
size
- the sizepublic boolean add(V value)
value
- the value to addpublic void clear()
public List<V> createList()
public List<V> createList(int size)
size
- the sizepublic V get(int index)
index
- index of the element to returnIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size())public List<V> getList()
public int indexOf(V value)
value
- element to search forClassCastException
- if the type of the specified element
is incompatible with this list (optional)NullPointerException
- if the specified element is null and this
list does not permit null elements (optional)public V put(String key, V value)
m.containsKey(k)
would return
true.)put
in interface Map<String,V>
put
in class TreeMap<String,V>
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyUnsupportedOperationException
- if the put operation
is not supported by this mapClassCastException
- if the class of the specified key or value
prevents it from being stored in this mapNullPointerException
- if the specified key or value is null
and this map does not permit null keys or valuesIllegalArgumentException
- if some property of the specified key
or value prevents it from being stored in this mappublic V put(String key, V value, int index)
m.containsKey(k)
would return
true.)key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyindex
- the index of the value in the listUnsupportedOperationException
- if the put operation
is not supported by this mapClassCastException
- if the class of the specified key or value
prevents it from being stored in this mapNullPointerException
- if the specified key or value is null
and this map does not permit null keys or valuesIllegalArgumentException
- if some property of the specified key
or value prevents it from being stored in this mappublic V putKey(String key, V value)
m.containsKey(k)
would return
true.)key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyUnsupportedOperationException
- if the put operation
is not supported by this mapClassCastException
- if the class of the specified key or value
prevents it from being stored in this mapNullPointerException
- if the specified key or value is null
and this map does not permit null keys or valuesIllegalArgumentException
- if some property of the specified key
or value prevents it from being stored in this mappublic V remove(Object key)
(key==null ? k==null : key.equals(k))
, that mapping
is removed. (The map can contain at most one such mapping.)
Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.
If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.
The map will not contain a mapping for the specified key once the call returns.
remove
in interface Map<String,V>
remove
in class TreeMap<String,V>
key
- key whose mapping is to be removed from the mapUnsupportedOperationException
- if the remove operation
is not supported by this mapClassCastException
- if the key is of an inappropriate type for
this map (optional)NullPointerException
- if the specified key is null and this
map does not permit null keys (optional)public V set(String key, V value, boolean replace)
replace
either returns old value associated with the key
(if replace == false) or associates the specified value with the key and replaces value in the list at the
index of the previous value in the specified value.key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyreplace
- if true
replaces existing association on the new oneCopyright © 2010-2020 Toolsverse. All Rights Reserved.