|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.classification.ContingencyFeatureCluster
public class ContingencyFeatureCluster
A cluster of contingency features
Field Summary | |
---|---|
protected java.util.List<Feature> |
contents
A set to hold the contents of this cluster |
protected ContingencyFeature |
counter
A counter for adding up the a,b,c,d values and calculating the final weight |
protected java.util.Set<java.lang.Integer> |
docIDs
|
protected static java.lang.String |
logTag
|
protected java.lang.String |
name
The name of this cluster |
protected java.util.Map<java.lang.Integer,Feature> |
quickIDMap
|
protected java.util.Map<java.lang.String,Feature> |
quickNameMap
|
Fields inherited from interface com.sun.labs.minion.classification.FeatureCluster |
---|
weightComparator |
Constructor Summary | |
---|---|
ContingencyFeatureCluster()
|
|
ContingencyFeatureCluster(java.lang.String name)
|
Method Summary | |
---|---|
void |
add(Feature f)
Add another feature to this cluster, incrementing the counts associated with it. |
int |
compareTo(FeatureCluster fc)
Compares to feature clusters on the basis of their names |
FeatureCluster |
copy()
Create a new feature cluster that is a copy of the given feature cluster. |
Feature |
get(int id)
Gets the feature with the given id out of this cluster. |
Feature |
get(java.lang.String name)
Gets the feature with the given name out of this cluster. |
java.util.SortedSet<Feature> |
getContents()
Gets the contents of the feature cluster. |
ContingencyFeature |
getCounter()
|
java.lang.String |
getHumanReadableName()
Gets a human-readable (for example, non-stemmed) name for this cluster. |
java.lang.String |
getName()
Gets the name of this feature cluster. |
float |
getWeight()
Gets the weight of this feature cluster. |
protected void |
innerAdd(Feature f)
|
java.util.Iterator<Feature> |
iterator()
Gets an iterator for the contents of this cluster. |
void |
merge(FeatureCluster other)
Merge another feature cluster into this one, preventing duplicates. |
void |
setName(java.lang.String name)
Sets the name of this feature cluster. |
void |
setWeight(float w)
Sets the weight of this feature cluster. |
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List<Feature> contents
protected java.lang.String name
protected static java.lang.String logTag
protected ContingencyFeature counter
protected java.util.Map<java.lang.Integer,Feature> quickIDMap
protected java.util.Map<java.lang.String,Feature> quickNameMap
protected java.util.Set<java.lang.Integer> docIDs
Constructor Detail |
---|
public ContingencyFeatureCluster()
public ContingencyFeatureCluster(java.lang.String name)
Method Detail |
---|
public FeatureCluster copy()
copy
in interface FeatureCluster
public void add(Feature f)
add
in interface FeatureCluster
f
- the feature to addprotected void innerAdd(Feature f)
public void merge(FeatureCluster other)
FeatureCluster
merge
in interface FeatureCluster
other
- the other clusterpublic java.util.SortedSet<Feature> getContents()
getContents
in interface FeatureCluster
public Feature get(java.lang.String name)
FeatureCluster
get
in interface FeatureCluster
name
- the feature name
public Feature get(int id)
FeatureCluster
get
in interface FeatureCluster
id
- the feature id
public java.util.Iterator<Feature> iterator()
iterator
in interface FeatureCluster
iterator
in interface java.lang.Iterable<Feature>
public int compareTo(FeatureCluster fc)
compareTo
in interface java.lang.Comparable<FeatureCluster>
public java.lang.String getName()
getName
in interface FeatureCluster
public java.lang.String getHumanReadableName()
FeatureCluster
getHumanReadableName
in interface FeatureCluster
public void setName(java.lang.String name)
setName
in interface FeatureCluster
name
- the new namepublic float getWeight()
getWeight
in interface FeatureCluster
public ContingencyFeature getCounter()
public void setWeight(float w)
setWeight
in interface FeatureCluster
w
- the new weightpublic java.lang.String toString()
toString
in class java.lang.Object
public int size()
size
in interface FeatureCluster
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |