|
||||||||||
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.DoubleHashMap<K>
K
- public class DoubleHashMap<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 double values.
Constructor Summary | |
---|---|
DoubleHashMap()
Constructor |
|
DoubleHashMap(K... keys)
Creates a DoubleHashMap with these keys set to 1 |
Method Summary | |
---|---|
void |
add(java.util.Collection<K> set)
increases the counters |
void |
add(DoubleHashMap<K> countBindings)
Adds all integer values up |
boolean |
add(K e)
|
boolean |
add(K key,
double delta)
Increases a value, true for 'added new key with delta as value', false for 'increased existing value' |
void |
clear()
|
double |
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)
|
double |
findMax()
Finds the maximum value |
double |
get(K key)
Retrieves a value |
double |
get(K 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,
double 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 DoubleHashMap()
public DoubleHashMap(K... keys)
Method Detail |
---|
public double get(K key)
public double get(K key, int defaultValue)
public boolean containsKey(java.lang.Object key)
public boolean add(K key, double delta)
public boolean increase(K key)
public PeekIterator<K> keys()
public boolean put(K key, double 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(DoubleHashMap<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 double findMax()
public double computeSum()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |