|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<K> javatools.datatypes.IntHashMap<K>
K
- public class IntHashMap<K>
This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). This class implements a HashMap with integer values.
Constructor Summary | |
---|---|
IntHashMap()
Constructor |
|
IntHashMap(java.util.Collection<K> keys)
Creates an intHashMap with these keys set to 1 |
|
IntHashMap(K... keys)
Creates an intHashMap with these keys set to 1 |
|
IntHashMap(java.util.Map<K,IntHashMap<K>> map)
Creates an intHashMap with the same keys and the sizes |
Method Summary | |
---|---|
void |
add(java.util.Collection<K> set)
increases the counters |
void |
add(IntHashMap<K> countBindings)
Adds all integer values up |
boolean |
add(K e)
|
boolean |
add(K key,
int delta)
Increases a value, true for 'added new key with delta as value', false for 'increased existing value' |
void |
addAll(IntHashMap<K> countBindings)
Adds all integer values up |
void |
clear()
|
long |
computeSum()
Computes the sum |
boolean |
contains(java.lang.Object o)
|
boolean |
containsKey(java.lang.Object key)
True if value is there |
java.util.List<K> |
decreasingKeys()
returns the keys in decreasing order |
boolean |
equals(java.lang.Object o)
|
int |
findMax()
Finds the maximum value |
int |
get(java.lang.Object key)
Retrieves a value |
int |
get(java.lang.Object key,
int defaultValue)
Retrieves a value |
int |
hashCode()
|
boolean |
increase(K key)
Increases a value, true for 'added new key with value 1', false for 'increased existing value' |
java.util.List<K> |
increasingKeys()
returns the keys in increasing order |
java.util.Iterator<K> |
iterator()
|
PeekIterator<K> |
keys()
Returns keys. |
static void |
main(java.lang.String[] args)
Test |
boolean |
put(K key,
int value)
Adds a key, true for 'added the key as new', false for 'overwrote existing value' |
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.util.AbstractSet |
---|
removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, isEmpty, remove, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
addAll, containsAll, isEmpty, remove, retainAll, toArray, toArray |
Constructor Detail |
---|
public IntHashMap()
public IntHashMap(K... keys)
public IntHashMap(java.util.Collection<K> keys)
public IntHashMap(java.util.Map<K,IntHashMap<K>> map)
Method Detail |
---|
public int get(java.lang.Object key)
public int get(java.lang.Object key, int defaultValue)
public boolean containsKey(java.lang.Object key)
public boolean add(K key, int delta)
public boolean increase(K key)
public PeekIterator<K> keys()
public boolean put(K key, int value)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public java.util.Iterator<K> iterator()
iterator
in interface java.lang.Iterable<K>
iterator
in interface java.util.Collection<K>
iterator
in interface java.util.Set<K>
iterator
in class java.util.AbstractCollection<K>
public int size()
size
in interface java.util.Collection<K>
size
in interface java.util.Set<K>
size
in class java.util.AbstractCollection<K>
public boolean add(K e)
add
in interface java.util.Collection<K>
add
in interface java.util.Set<K>
add
in class java.util.AbstractCollection<K>
public void clear()
clear
in interface java.util.Collection<K>
clear
in interface java.util.Set<K>
clear
in class java.util.AbstractCollection<K>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<K>
contains
in interface java.util.Set<K>
contains
in class java.util.AbstractCollection<K>
public void add(IntHashMap<K> countBindings)
public void addAll(IntHashMap<K> countBindings)
public void add(java.util.Collection<K> set)
public java.lang.String toString()
toString
in class java.util.AbstractCollection<K>
public java.util.List<K> increasingKeys()
public java.util.List<K> decreasingKeys()
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<K>
equals
in interface java.util.Set<K>
equals
in class java.util.AbstractSet<K>
public int hashCode()
hashCode
in interface java.util.Collection<K>
hashCode
in interface java.util.Set<K>
hashCode
in class java.util.AbstractSet<K>
public int findMax()
public long computeSum()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |