com.samskivert.util
Class Collections.SynchronizedIntMap<V>

java.lang.Object
  extended by com.samskivert.util.Collections.SynchronizedIntMap<V>
All Implemented Interfaces:
IntMap<V>, Map<Integer,V>
Enclosing class:
Collections

protected static class Collections.SynchronizedIntMap<V>
extends Object
implements IntMap<V>

Horked from the Java util class and extended for IntMap.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.samskivert.util.IntMap
IntMap.IntEntry<V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 void clear()
           
 boolean containsKey(int key)
          Returns true if this map contains a mapping for the specified key.
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<Integer,V>> entrySet()
           
 boolean equals(Object o)
           
 V get(int key)
          Returns the value to which this map maps the specified key.
 V get(Object key)
           
 int hashCode()
           
 Set<IntMap.IntEntry<V>> intEntrySet()
          Returns a set of all the map entries.
 IntSet intKeySet()
          Get a set of all the keys, as an IntSet.
 boolean isEmpty()
           
 Set<Integer> keySet()
           
 V put(Integer key, V value)
           
 V put(int key, V value)
          Associates the specified value with the specified key in this map.
 void putAll(Map<? extends Integer,? extends V> map)
           
 V remove(int key)
          Removes the mapping for this key from this map if present.
 V remove(Object key)
           
 int size()
           
 String toString()
           
 Collection<V> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

size

public int size()
Specified by:
size in interface Map<Integer,V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<Integer,V>

containsKey

public boolean containsKey(int key)
Description copied from interface: IntMap
Returns true if this map contains a mapping for the specified key.

Specified by:
containsKey in interface IntMap<V>
Parameters:
key - key whose presence in this map is to be tested.
Returns:
true if this map contains a mapping for the specified key.

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<Integer,V>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<Integer,V>

get

public V get(int key)
Description copied from interface: IntMap
Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key.

Specified by:
get in interface IntMap<V>
Parameters:
key - key whose associated value is to be returned.
Returns:
the value to which this map maps the specified key, or null if the map contains no mapping for this key.

get

public V get(Object key)
Specified by:
get in interface Map<Integer,V>

put

public V put(int key,
             V value)
Description copied from interface: IntMap
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.

Specified by:
put in interface IntMap<V>
Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.
Returns:
previous value associated with specified key, or null if there was no mapping for key.

put

public V put(Integer key,
             V value)
Specified by:
put in interface Map<Integer,V>

remove

public V remove(int key)
Description copied from interface: IntMap
Removes the mapping for this key from this map if present.

Specified by:
remove in interface IntMap<V>
Parameters:
key - key whose mapping is to be removed from the map.
Returns:
previous value associated with specified key, or null if there was no mapping for key.

remove

public V remove(Object key)
Specified by:
remove in interface Map<Integer,V>

putAll

public void putAll(Map<? extends Integer,? extends V> map)
Specified by:
putAll in interface Map<Integer,V>

clear

public void clear()
Specified by:
clear in interface Map<Integer,V>

keySet

public Set<Integer> keySet()
Specified by:
keySet in interface Map<Integer,V>

intKeySet

public IntSet intKeySet()
Description copied from interface: IntMap
Get a set of all the keys, as an IntSet.

Specified by:
intKeySet in interface IntMap<V>

entrySet

public Set<Map.Entry<Integer,V>> entrySet()
Specified by:
entrySet in interface Map<Integer,V>

intEntrySet

public Set<IntMap.IntEntry<V>> intEntrySet()
Description copied from interface: IntMap
Returns a set of all the map entries.

Specified by:
intEntrySet in interface IntMap<V>

values

public Collection<V> values()
Specified by:
values in interface Map<Integer,V>

equals

public boolean equals(Object o)
Specified by:
equals in interface Map<Integer,V>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<Integer,V>
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.