public class FeatureComparator extends Object implements Comparator<FeatureVector>
Constructor and Description |
---|
FeatureComparator(int setI,
FeatureVector.FeatureType featureType)
Constructor which initializes the feature index.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(FeatureVector a,
FeatureVector b)
Compares two feature vectors according to their values at an internal index previously set by this.setFeatureIdx().
|
boolean |
equals(Object obj)
The equals() method asked for by the Comparable interface.
|
int |
getFeatureIdx()
Access the index of the currently compared feature.
|
void |
setFeatureIdx(int setI,
FeatureVector.FeatureType featureType)
Accessor to set the feature index.
|
public FeatureComparator(int setI, FeatureVector.FeatureType featureType)
setI
- The index of the feature to be compared on the next run of the comparator.featureType
- feature Typepublic void setFeatureIdx(int setI, FeatureVector.FeatureType featureType)
setI
- The index of the feature to be compared on the next run of the comparator.featureType
- feature typepublic int getFeatureIdx()
public int compare(FeatureVector a, FeatureVector b)
compare
in interface Comparator<FeatureVector>
a
- The first vector.b
- The second vector.setFeatureIdx(int setI, FeatureVector.FeatureType featureType)
.public boolean equals(Object obj)
equals
in interface Comparator<FeatureVector>
equals
in class Object
obj
- objCopyright © 2000–2016 DFKI GmbH. All rights reserved.