|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.stats.TwoDimensionalCounter<K1,K2>
public class TwoDimensionalCounter<K1,K2>
A class representing a mapping between pairs of typed objects and double values.
Constructor Summary | |
---|---|
TwoDimensionalCounter()
|
|
TwoDimensionalCounter(MapFactory<K1,ClassicCounter<K2>> outerFactory,
MapFactory<K2,MutableDouble> innerFactory)
|
Method Summary | ||
---|---|---|
void |
addAll(K1 key,
ClassicCounter<K2> c)
|
|
void |
addAll(TwoDimensionalCounter<K1,K2> c)
|
|
void |
clean()
|
|
boolean |
containsKey(K1 o1,
K2 o2)
|
|
void |
decrementCount(K1 o1,
K2 o2)
|
|
void |
decrementCount(K1 o1,
K2 o2,
double count)
|
|
double |
defaultReturnValue()
|
|
void |
defaultReturnValue(double rv)
|
|
Set<Map.Entry<K1,ClassicCounter<K2>>> |
entrySet()
|
|
boolean |
equals(Object o)
|
|
Set<K1> |
firstKeySet()
|
|
ClassicCounter<Pair<K1,K2>> |
flatten()
|
|
double |
getCount(K1 o1,
K2 o2)
|
|
ClassicCounter<K2> |
getCounter(K1 o)
|
|
MapFactory<K2,MutableDouble> |
getInnerMapFactory()
|
|
MapFactory<K1,ClassicCounter<K2>> |
getOuterMapFactory()
|
|
int |
hashCode()
|
|
void |
incrementCount(K1 o1,
K2 o2)
|
|
void |
incrementCount(K1 o1,
K2 o2,
double count)
|
|
boolean |
isEmpty()
|
|
static void |
main(String[] args)
|
|
void |
remove(K1 key)
|
|
double |
remove(K1 o1,
K2 o2)
|
|
void |
removeZeroCounts()
|
|
static
|
reverseIndexOrder(TwoDimensionalCounter<K1,K2> cc)
Produces a new ConditionalCounter. |
|
Set<K2> |
secondKeySet()
|
|
void |
setCount(K1 o1,
K2 o2,
double count)
|
|
ClassicCounter<K2> |
setCounter(K1 o,
ClassicCounter<K2> c)
replace the counter for K1-index o by new counter c |
|
int |
size()
|
|
void |
subtractAll(K1 key,
ClassicCounter<K2> c)
|
|
void |
subtractAll(TwoDimensionalCounter<K1,K2> c,
boolean removeKeys)
|
|
String |
toCSVString(NumberFormat nf)
|
|
double[][] |
toMatrix(List<K1> firstKeys,
List<K2> secondKeys)
Given an ordering of the first (row) and second (column) keys, will produce a double matrix. |
|
String |
toMatrixString(int cellSize)
|
|
String |
toString()
A simple String representation of this TwoDimensionalCounter, which has the String representation of each key pair on a separate line, followed by the count for that pair. |
|
double |
totalCount()
Takes linear time. |
|
double |
totalCount(K1 k1)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TwoDimensionalCounter()
public TwoDimensionalCounter(MapFactory<K1,ClassicCounter<K2>> outerFactory, MapFactory<K2,MutableDouble> innerFactory)
Method Detail |
---|
public void defaultReturnValue(double rv)
public double defaultReturnValue()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public ClassicCounter<K2> getCounter(K1 o)
public Set<Map.Entry<K1,ClassicCounter<K2>>> entrySet()
public int size()
public boolean containsKey(K1 o1, K2 o2)
public void incrementCount(K1 o1, K2 o2)
public void incrementCount(K1 o1, K2 o2, double count)
public void decrementCount(K1 o1, K2 o2)
public void decrementCount(K1 o1, K2 o2, double count)
public void setCount(K1 o1, K2 o2, double count)
public double remove(K1 o1, K2 o2)
public double getCount(K1 o1, K2 o2)
public double totalCount()
public double totalCount(K1 k1)
public Set<K1> firstKeySet()
public ClassicCounter<K2> setCounter(K1 o, ClassicCounter<K2> c)
public static <K1,K2> TwoDimensionalCounter<K2,K1> reverseIndexOrder(TwoDimensionalCounter<K1,K2> cc)
public String toString()
toString
in class Object
public String toMatrixString(int cellSize)
public double[][] toMatrix(List<K1> firstKeys, List<K2> secondKeys)
public String toCSVString(NumberFormat nf)
public Set<K2> secondKeySet()
public boolean isEmpty()
public ClassicCounter<Pair<K1,K2>> flatten()
public void addAll(TwoDimensionalCounter<K1,K2> c)
public void addAll(K1 key, ClassicCounter<K2> c)
public void subtractAll(K1 key, ClassicCounter<K2> c)
public void subtractAll(TwoDimensionalCounter<K1,K2> c, boolean removeKeys)
public void removeZeroCounts()
public void remove(K1 key)
public void clean()
public MapFactory<K1,ClassicCounter<K2>> getOuterMapFactory()
public MapFactory<K2,MutableDouble> getInnerMapFactory()
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |