|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.HashMap<K,V>
@Deprecated public class HashMap<K,V>
Nested Class Summary | |
---|---|
static class |
HashMap.Entry<K,V>
Deprecated. |
Constructor Summary | |
---|---|
HashMap()
Deprecated. |
|
HashMap(int arrayListSize)
Deprecated. |
|
HashMap(Map<K,V> m)
Deprecated. |
|
HashMap(Map<K,V> m,
int arrayListSize)
Deprecated. |
Method Summary | |
---|---|
void |
clear()
Deprecated. Removes all mappings from this map (optional operation). |
boolean |
containsKey(Object key)
Deprecated. Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(Object value)
Deprecated. Returns true if this map maps one or more keys to the specified value. |
Set<Map.Entry<K,V>> |
entrySet()
Deprecated. Returns a set view of the mappings contained in this map. |
boolean |
equals(Object o)
Deprecated. Compares the specified object with this map for equality. |
V |
get(Object key)
Deprecated. Returns the value to which this map maps the specified key. |
int |
hashCode()
Deprecated. Returns the hash code value for this map. |
boolean |
isEmpty()
Deprecated. Returns true if this map contains no key-value mappings. |
Set<K> |
keySet()
Deprecated. Returns a set view of the keys contained in this map. |
V |
put(K key,
V value)
Deprecated. Associates the specified value with the specified key in this map (optional operation). |
void |
putAll(Map<? extends K,? extends V> t)
Deprecated. Copies all of the mappings from the specified map to this map (optional operation). |
V |
remove(Object key)
Deprecated. Removes the mapping for this key from this map if it is present (optional operation). |
int |
size()
Deprecated. Returns the number of key-value mappings in this map. |
Collection<V> |
values()
Deprecated. Returns a collection view of the values contained in this map. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashMap()
public HashMap(int arrayListSize)
arrayListSize
- size for array listpublic HashMap(Map<K,V> m)
public HashMap(Map<K,V> m, int arrayListSize)
Method Detail |
---|
public void clear()
Map
clear
in interface Map<K,V>
public boolean containsKey(Object key)
Map
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
Map
containsValue
in interface Map<K,V>
public Set<Map.Entry<K,V>> entrySet()
Map
entrySet
in interface Map<K,V>
public V get(Object key)
Map
get
in interface Map<K,V>
public boolean isEmpty()
Map
isEmpty
in interface Map<K,V>
public Set<K> keySet()
Map
keySet
in interface Map<K,V>
public V put(K key, V value)
Map
put
in interface Map<K,V>
public void putAll(Map<? extends K,? extends V> t)
Map
putAll
in interface Map<K,V>
public V remove(Object key)
Map
remove
in interface Map<K,V>
public int size()
Map
size
in interface Map<K,V>
public Collection<V> values()
Map
values
in interface Map<K,V>
public boolean equals(Object o)
This implementation first checks if the specified object is this map; if so it returns true. Then, it checks if the specified object is a map whose size is identical to the size of this map; if not, it returns false. If so, it iterates over this map's entrySet collection, and checks that the specified map contains each mapping that this map contains. If the specified map fails to contain such a mapping, false is returned. If the iteration completes, true is returned.
equals
in interface Map<K,V>
equals
in class Object
o
- object to be compared for equality with this map
public int hashCode()
Object.hashCode()
.
This implementation iterates over entrySet(), calling
hashCode()
on each element (entry) in the
set, and adding up the results.
hashCode
in interface Map<K,V>
hashCode
in class Object
HashMap.Entry.hashCode()
,
Object.equals(Object)
,
Set.equals(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |