L - The type of the label of the datumF - The type of individual features stored in the datumpublic class RVFDatum<L,F> extends java.lang.Object implements Datum<L,F>
| Constructor and Description |
|---|
RVFDatum()
Constructs a new RVFDatum with no features or labels.
|
RVFDatum(Counter<F> features)
Constructs a new RVFDatum with the given features and no labels.
|
RVFDatum(Counter<F> features,
L label)
Constructs a new RVFDatum with the given features and label.
|
RVFDatum(Datum<L,F> m)
Constructs a new RVFDatum taking the data from a Datum.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<F> |
asFeatures()
Returns the list of features without values
|
Counter<F> |
asFeaturesCounter()
Returns the Counter of features and values
|
boolean |
equals(java.lang.Object o)
Returns whether the given RVFDatum contains the same features with the same
values as this RVFDatum.
|
double |
getFeatureCount(F feature) |
int |
hashCode() |
java.lang.String |
id() |
L |
label()
Returns the primary label for this Object, or null if none have been set.
|
java.util.Collection<L> |
labels()
Returns the complete list of labels for this Object, which may be empty.
|
void |
setID(java.lang.String id)
Sets id for this instance
|
void |
setLabel(L label)
Removes all currently assigned Labels for this Datum then adds the given
Label.
|
java.lang.String |
toString()
Returns a String representation of this BasicDatum (lists features and
labels).
|
public RVFDatum(Counter<F> features, L label)
public RVFDatum(Datum<L,F> m)
m - The Datum to copy.public RVFDatum(Counter<F> features)
public RVFDatum()
public java.util.Collection<F> asFeatures()
asFeatures in interface Featurizable<F>public void setLabel(L label)
public void setID(java.lang.String id)
id - public java.lang.String toString()
toString in class java.lang.Objectpublic L label()
Labeledpublic java.util.Collection<L> labels()
Labeledpublic double getFeatureCount(F feature)
public java.lang.String id()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object