L
- The type of the label of the datumF
- The type of individual features stored in the datumpublic class RVFDatum<L,F> extends 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 |
---|---|
Collection<F> |
asFeatures()
Returns the list of features without values
|
Counter<F> |
asFeaturesCounter()
Returns the Counter of features and values
|
boolean |
equals(Object o)
Returns whether the given RVFDatum contains the same features with the same
values as this RVFDatum.
|
double |
getFeatureCount(F feature) |
int |
hashCode() |
String |
id() |
L |
label()
Returns the primary label for this Object, or null if none have been set.
|
Collection<L> |
labels()
Returns the complete list of labels for this Object, which may be empty.
|
void |
setID(String id)
Sets id for this instance
|
void |
setLabel(L label)
Removes all currently assigned Labels for this Datum then adds the given
Label.
|
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 Collection<F> asFeatures()
asFeatures
in interface Featurizable<F>
public void setLabel(L label)
public void setID(String id)
id
- public String toString()
public L label()
Labeled
public Collection<L> labels()
Labeled
public double getFeatureCount(F feature)
public String id()
public boolean equals(Object o)