|
|||||||||
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 factory)
|
Method Summary | |
---|---|
void |
addAll(TwoDimensionalCounter<K1,K2> c)
|
boolean |
containsKey(K1 o1,
K2 o2)
|
java.util.Set<K1> |
firstKeySet()
|
Counter<Pair<K1,K2>> |
flatten()
|
double |
getCount(K1 o1,
K2 o2)
|
Counter<K2> |
getCounter(K1 o)
|
MapFactory |
getMapFactory()
|
void |
incrementCount(K1 o1,
K2 o2)
|
void |
incrementCount(K1 o1,
K2 o2,
double count)
|
boolean |
isEmpty()
|
static void |
main(java.lang.String[] args)
|
static TwoDimensionalCounter |
reverseIndexOrder(TwoDimensionalCounter cc)
Produces a new ConditionalCounter. |
java.util.Set<K2> |
secondKeySet()
|
void |
setCount(K1 o1,
K2 o2,
double count)
|
Counter<K2> |
setCounter(K1 o,
Counter<K2> c)
|
int |
size()
|
void |
subtractAll(TwoDimensionalCounter<K1,K2> c,
boolean removeKeys)
|
java.lang.String |
toCSVString(java.text.NumberFormat nf)
|
java.lang.String |
toDatFileString()
|
double[][] |
toMatrix(java.util.List<K1> firstKeys,
java.util.List<K2> secondKeys)
Given an ordering of the first (row) and second (column) keys, will produce a double matrix. |
java.lang.String |
toMatrixString(int cellSize)
|
java.lang.String |
toString()
|
double |
totalCount()
Takes linear time. |
double |
totalCount(K1 k1)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TwoDimensionalCounter()
public TwoDimensionalCounter(MapFactory factory)
Method Detail |
---|
public Counter<K2> getCounter(K1 o)
o
-
public int size()
public boolean containsKey(K1 o1, K2 o2)
public void incrementCount(K1 o1, K2 o2)
o1
- o2
- public void incrementCount(K1 o1, K2 o2, double count)
o1
- o2
- count
- public void setCount(K1 o1, K2 o2, double count)
o1
- o2
- count
- public double getCount(K1 o1, K2 o2)
o1
- o2
-
public double totalCount()
public double totalCount(K1 k1)
public java.util.Set<K1> firstKeySet()
public Counter<K2> setCounter(K1 o, Counter<K2> c)
public static TwoDimensionalCounter reverseIndexOrder(TwoDimensionalCounter cc)
cc
-
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDatFileString()
public java.lang.String toMatrixString(int cellSize)
public double[][] toMatrix(java.util.List<K1> firstKeys, java.util.List<K2> secondKeys)
firstKeys
- secondKeys
-
public java.lang.String toCSVString(java.text.NumberFormat nf)
public java.util.Set<K2> secondKeySet()
public boolean isEmpty()
public Counter<Pair<K1,K2>> flatten()
public void addAll(TwoDimensionalCounter<K1,K2> c)
public void subtractAll(TwoDimensionalCounter<K1,K2> c, boolean removeKeys)
public MapFactory getMapFactory()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |