cz.cuni.amis.utils.maps
Class CountIntMap<KEY>

Package class diagram package CountIntMap
java.lang.Object
  extended by cz.cuni.amis.utils.maps.CountIntMap<KEY>
All Implemented Interfaces:
Map<KEY,Integer>

public class CountIntMap<KEY>
extends Object
implements Map<KEY,Integer>


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
CountIntMap()
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 int decrease(KEY key)
          Increase 'key' -1 returning previous value.
 int decrease(KEY key, int amount)
          Increase 'key' -amount returning previous value.
 Set<Map.Entry<KEY,Integer>> entrySet()
           
 Integer get(Object key)
           
 int increase(KEY key)
          Increase 'key' +1 returning previous value.
 int increase(KEY key, int amount)
          Increase 'key' +amount returning previous value.
 boolean isEmpty()
           
 Set<KEY> keySet()
           
 int multi(KEY key, int amount)
          Multiplies 'key' with amount returning previous value.
 Integer put(KEY key, Integer value)
           
 void putAll(Map<? extends KEY,? extends Integer> m)
           
 Integer remove(Object key)
           
 int set(KEY key, int value)
          Sets key to 'value' returning previously associated value (alias for put(Object, Integer)).
 int size()
           
 Collection<Integer> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

CountIntMap

public CountIntMap()
Method Detail

clear

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

keySet

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

entrySet

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

values

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

get

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

remove

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

set

public int set(KEY key,
               int value)
Sets key to 'value' returning previously associated value (alias for put(Object, Integer)).

Parameters:
key -
value -
Returns:

increase

public int increase(KEY key)
Increase 'key' +1 returning previous value.

Parameters:
key -
Returns:

increase

public int increase(KEY key,
                    int amount)
Increase 'key' +amount returning previous value.

Parameters:
key -
Returns:

decrease

public int decrease(KEY key)
Increase 'key' -1 returning previous value.

Parameters:
key -
Returns:

decrease

public int decrease(KEY key,
                    int amount)
Increase 'key' -amount returning previous value.

Parameters:
key -
Returns:

multi

public int multi(KEY key,
                 int amount)
Multiplies 'key' with amount returning previous value.

Parameters:
key -
Returns:

containsKey

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

containsValue

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

isEmpty

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

put

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

putAll

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

size

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


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.