|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.dbm.BasicDatum
Basic implementation of Datum interface that can be constructed with a Collection of features and one more more labels. The features must be specified at construction, but the labels can be set and/or changed later.
Constructor Summary | |
BasicDatum()
Constructs a new BasicDatum with no features or labels. |
|
BasicDatum(Collection features)
Constructs a new BasicDatum with the given features and no labels. |
|
BasicDatum(Collection features,
Collection labels)
Constructs a new BasicDatum with the given features and labels. |
|
BasicDatum(Collection features,
Label label)
Constructs a new BasicDatum with the given features and label. |
Method Summary | |
void |
addLabel(Label label)
Adds the given Label to the List of labels for this Datum if it is not null. |
Collection |
asFeatures()
Returns the collection that this BasicDatum was constructed with. |
Label |
label()
Returns the first label for this Datum, or null if none have been set. |
Collection |
labels()
Returns the complete List of labels for this Datum, which may be empty. |
void |
setLabel(Label label)
Removes all currently assigned Labels for this Datum then adds the given Label. |
void |
setLabels(Collection labels)
Removes all currently assigned labels for this Datum then adds all of the given Labels. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicDatum(Collection features, Collection labels)
public BasicDatum(Collection features, Label label)
public BasicDatum(Collection features)
public BasicDatum()
Method Detail |
public Collection asFeatures()
asFeatures
in interface Featurizable
public Label label()
label
in interface Labeled
public Collection labels()
labels
in interface Labeled
public void setLabel(Label label)
setLabel
in interface Labeled
public void setLabels(Collection labels)
setLabels
in interface Labeled
public void addLabel(Label label)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |