|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.stats.TwoDimensionalIntCounter<K1,K2>
public class TwoDimensionalIntCounter<K1,K2>
A class representing a mapping between pairs of typed objects and int values. (Copied from TwoDimensionalCounter)
Constructor Summary | |
---|---|
TwoDimensionalIntCounter()
|
|
TwoDimensionalIntCounter(int initialCapacity)
|
|
TwoDimensionalIntCounter(MapFactory<K1,IntCounter<K2>> outerFactory,
MapFactory<K2,MutableInteger> innerFactory)
|
|
TwoDimensionalIntCounter(MapFactory<K1,IntCounter<K2>> outerFactory,
MapFactory<K2,MutableInteger> innerFactory,
int initialCapacity)
|
Method Summary | ||
---|---|---|
void |
addAll(K1 key,
IntCounter<K2> c)
|
|
void |
addAll(TwoDimensionalIntCounter<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)
|
|
void |
decrementCount(K1 o1,
K2 o2,
int count)
|
|
int |
defaultReturnValue()
|
|
void |
defaultReturnValue(double rv)
|
|
void |
defaultReturnValue(int rv)
|
|
java.util.Set<java.util.Map.Entry<K1,IntCounter<K2>>> |
entrySet()
|
|
boolean |
equals(java.lang.Object o)
|
|
java.util.Set<K1> |
firstKeySet()
|
|
IntCounter<Pair<K1,K2>> |
flatten()
|
|
int |
getCount(K1 o1,
K2 o2)
|
|
IntCounter<K2> |
getCounter(K1 o)
|
|
MapFactory<K2,MutableInteger> |
getInnerMapFactory()
|
|
MapFactory<K1,IntCounter<K2>> |
getOuterMapFactory()
|
|
int |
hashCode()
|
|
void |
incrementCount(K1 o1,
K2 o2)
|
|
void |
incrementCount(K1 o1,
K2 o2,
double count)
|
|
void |
incrementCount(K1 o1,
K2 o2,
int count)
|
|
boolean |
isEmpty()
|
|
static void |
main(java.lang.String[] args)
|
|
void |
remove(K1 key)
|
|
int |
remove(K1 o1,
K2 o2)
|
|
void |
removeZeroCounts()
|
|
static
|
reverseIndexOrder(TwoDimensionalIntCounter<K1,K2> cc)
Produces a new ConditionalCounter. |
|
java.util.Set<K2> |
secondKeySet()
|
|
void |
setCount(K1 o1,
K2 o2,
double count)
|
|
void |
setCount(K1 o1,
K2 o2,
int count)
|
|
IntCounter<K2> |
setCounter(K1 o,
IntCounter<K2> c)
replace the counter for K1-index o by new counter c |
|
int |
size()
|
|
void |
subtractAll(K1 key,
IntCounter<K2> c)
|
|
void |
subtractAll(TwoDimensionalIntCounter<K1,K2> c,
boolean removeKeys)
|
|
java.lang.String |
toCSVString(java.text.NumberFormat nf)
|
|
int[][] |
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()
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. |
|
int |
totalCount()
Takes linear time. |
|
int |
totalCount(K1 k1)
|
|
IntCounter<K1> |
totalCounts()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TwoDimensionalIntCounter()
public TwoDimensionalIntCounter(int initialCapacity)
public TwoDimensionalIntCounter(MapFactory<K1,IntCounter<K2>> outerFactory, MapFactory<K2,MutableInteger> innerFactory)
public TwoDimensionalIntCounter(MapFactory<K1,IntCounter<K2>> outerFactory, MapFactory<K2,MutableInteger> innerFactory, int initialCapacity)
Method Detail |
---|
public void defaultReturnValue(double rv)
public void defaultReturnValue(int rv)
public int defaultReturnValue()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public IntCounter<K2> getCounter(K1 o)
public java.util.Set<java.util.Map.Entry<K1,IntCounter<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 incrementCount(K1 o1, K2 o2, int count)
public void decrementCount(K1 o1, K2 o2)
public void decrementCount(K1 o1, K2 o2, double count)
public void decrementCount(K1 o1, K2 o2, int count)
public void setCount(K1 o1, K2 o2, double count)
public void setCount(K1 o1, K2 o2, int count)
public int remove(K1 o1, K2 o2)
public int getCount(K1 o1, K2 o2)
public int totalCount()
public int totalCount(K1 k1)
public IntCounter<K1> totalCounts()
public java.util.Set<K1> firstKeySet()
public IntCounter<K2> setCounter(K1 o, IntCounter<K2> c)
public static <K1,K2> TwoDimensionalIntCounter<K2,K1> reverseIndexOrder(TwoDimensionalIntCounter<K1,K2> cc)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toMatrixString(int cellSize)
public int[][] toMatrix(java.util.List<K1> firstKeys, java.util.List<K2> secondKeys)
public java.lang.String toCSVString(java.text.NumberFormat nf)
public java.util.Set<K2> secondKeySet()
public boolean isEmpty()
public IntCounter<Pair<K1,K2>> flatten()
public void addAll(TwoDimensionalIntCounter<K1,K2> c)
public void addAll(K1 key, IntCounter<K2> c)
public void subtractAll(K1 key, IntCounter<K2> c)
public void subtractAll(TwoDimensionalIntCounter<K1,K2> c, boolean removeKeys)
public void removeZeroCounts()
public void remove(K1 key)
public void clean()
public MapFactory<K1,IntCounter<K2>> getOuterMapFactory()
public MapFactory<K2,MutableInteger> getInnerMapFactory()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |