public class ListMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>, java.lang.Cloneable, java.io.Serializable
构造器和说明 |
---|
ListMap()
Creates new ListMap
|
ListMap(int initialCapacity)
Creates new ListMap specifying the initial capacity.
|
ListMap(int initialCapacity,
float loadFactor)
Creates new ListMap specifying the initial capacity and load factor.
|
ListMap(java.util.Map t)
Creates new ListMap from an existing Map
|
限定符和类型 | 方法和说明 |
---|---|
void |
clear()
清空map
|
java.lang.Object |
clone()
Returns a clone of the Map.
|
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key.是否包含键值
|
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value.是否包含值
|
java.util.Set |
entrySet()
Returns a set view of the mappings contained in this map.得到entrySet
|
boolean |
equals(java.lang.Object o)
Compares the specified object with this map for equality.
|
V |
get(java.lang.Object key)
Returns the value to which this map maps the specified key.
|
java.lang.Object |
getByIndex(int index)
Returns the mapping at the specified index.
|
K |
getKeyByIndex(int index) |
int |
hashCode()
Returns the hash code value for this map. hash码
|
int |
indexOf(java.lang.Object key)
Returns the index in this Map of the specified key.
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.是否是空的
|
java.util.Set |
keySet()
Returns a set view of the keys contained in this map.
|
V |
put(int index,
K key,
V value)
Adds an object to the Map.
|
V |
put(K key,
V value)
Adds an object to the Map.
|
void |
putAll(java.util.Map t)
Copies all of the mappings from the specified map to this map.
|
java.lang.Object |
remove(int index)
Removes the mapping for this index from this map if it is present.
|
V |
remove(java.lang.Object key)
Removes the mapping for this key from this map if it is present.
|
int |
size()
Returns the number of key-value mappings in this map.大小
|
java.util.Collection |
values()
Returns a collection view of the values contained in this map.
|
public ListMap()
public ListMap(int initialCapacity)
initialCapacity
- The initial capacity.public ListMap(int initialCapacity, float loadFactor)
initialCapacity
- The initial capacity.loadFactor
- The loadFactor.public ListMap(java.util.Map t)
t
- An existing Map.public V put(K key, V value)
put
在接口中 java.util.Map<K,V>
key
- The key used for adding the object. 键value
- The object to be added. 值public V remove(java.lang.Object key)
public java.util.Set keySet()
public java.util.Collection values()
public int hashCode()
public boolean containsKey(java.lang.Object key)
public int size()
public java.util.Set entrySet()
public boolean containsValue(java.lang.Object value)
public void putAll(java.util.Map t)
public boolean equals(java.lang.Object o)
public boolean isEmpty()
public V get(java.lang.Object key)
public V put(int index, K key, V value)
index
- The position at which the the object will be added.序号key
- The key used for adding the object. 键值value
- The object to be added. 值public java.lang.Object getByIndex(int index)
index
- The position at from which the mapping is to be retrieved.public K getKeyByIndex(int index)
public java.lang.Object remove(int index)
index
- The position at from which the mapping is to be removed.移除public int indexOf(java.lang.Object key)
key
- The key used for adding the object. 键值public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
在类中 java.lang.Object
java.lang.CloneNotSupportedException
- if cloning is not supported. Should never happen.