public class CounterMap<F,S>
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<F,Counter<S>> |
maps |
| Constructor and Description |
|---|
CounterMap() |
| Modifier and Type | Method and Description |
|---|---|
Pair<F,S> |
argMax()
This method returns pair of elements with a max value
|
void |
clear()
This method purges all counters
|
void |
clear(F element)
This method purges counter for a given first element
|
double |
getCount(F first,
S second)
This method returns counts for a given first/second pair
|
Counter<S> |
getCounter(F first)
This method returns counter for a given first element
|
java.util.Iterator<Pair<F,S>> |
getIterator()
This method returns Iterator of all first/second pairs stored in this counter
|
void |
incrementAll(CounterMap<F,S> other)
This method will increment values of this counter, by counts of other counter
|
void |
incrementCount(F first,
S second,
double inc)
This method will increment counts for a given first/second pair
|
boolean |
isEmpty()
This method checks if this CounterMap has any values stored
|
boolean |
isEmpty(F element)
This method checks if this CounterMap has any values stored for a given first element
|
java.util.Set<F> |
keySet()
This method returns Set of all first elements
|
double |
setCount(F first,
S second,
double value)
This method allows you to set counter value for a given first/second pair
|
int |
size()
This method returns number of First elements in this CounterMap
|
int |
totalSize()
This method returns total number of elements in this CounterMap
|
public boolean isEmpty()
public boolean isEmpty(F element)
element - public void incrementAll(CounterMap<F,S> other)
other - public void incrementCount(F first, S second, double inc)
first - second - inc - public double getCount(F first, S second)
first - second - public double setCount(F first, S second, double value)
first - second - value - public void clear()
public void clear(F element)
element - public java.util.Set<F> keySet()
public Counter<S> getCounter(F first)
first - public java.util.Iterator<Pair<F,S>> getIterator()
public int size()
public int totalSize()
Copyright © 2019. All rights reserved.