public class Feature extends Object implements Serializable, Cloneable, Comparable<Feature>
Features can be manufactured by the Example
and are not expected
to be long lived objects. They may be deconstructed when stored in an Example.
One day they should become value/inline types.
Modifier and Type | Field and Description |
---|---|
protected String |
name
The feature name.
|
protected double |
value
The feature value.
|
Constructor and Description |
---|
Feature(String name,
double value)
Creates an immutable feature.
|
Modifier and Type | Method and Description |
---|---|
Feature |
clone() |
int |
compareTo(Feature o) |
boolean |
equals(Object o) |
static Comparator<Feature> |
featureNameComparator()
A comparator using the lexicographic ordering of feature names.
|
String |
getName()
Returns the feature name.
|
double |
getValue()
Returns the feature value.
|
int |
hashCode() |
String |
toHTML()
Returns the feature name formatted as a table cell.
|
String |
toString() |
protected final String name
protected final double value
public Feature(String name, double value)
name
- The feature name.value
- The feature value.public String getName()
public double getValue()
public String toHTML()
public static Comparator<Feature> featureNameComparator()
public int compareTo(Feature o)
compareTo
in interface Comparable<Feature>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.