com.sun.labs.minion.classification
Class ClusterWeightComparator
java.lang.Object
com.sun.labs.minion.classification.ClusterWeightComparator
- All Implemented Interfaces:
- java.util.Comparator<FeatureCluster>
public class ClusterWeightComparator
- extends java.lang.Object
- implements java.util.Comparator<FeatureCluster>
A comparator for weighted features that compares features based on their
weight.
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ascending
protected boolean ascending
dups
protected boolean dups
ClusterWeightComparator
public ClusterWeightComparator()
ClusterWeightComparator
public ClusterWeightComparator(boolean ascending)
ClusterWeightComparator
public ClusterWeightComparator(boolean ascending,
boolean dups)
equals
public boolean equals(java.lang.Object o)
- Tests whether this comparator is equal to another.
- Specified by:
equals in interface java.util.Comparator<FeatureCluster>- Overrides:
equals in class java.lang.Object
- Parameters:
o - another comparator.
compare
public int compare(FeatureCluster fc1,
FeatureCluster fc2)
- Compares two weighted features by their weights.
- Specified by:
compare in interface java.util.Comparator<FeatureCluster>
- Parameters:
fc1 - the first feature clusterfc2 - the second feature cluster
- Returns:
- a negative integer, zero, or a positive integer as the first
argument is less than, equal to, or greater than the second.