com.sun.labs.minion.classification
Class ClusterWeightComparator

java.lang.Object
  extended by 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.


Field Summary
protected  boolean ascending
           
protected  boolean dups
           
 
Constructor Summary
ClusterWeightComparator()
           
ClusterWeightComparator(boolean ascending)
           
ClusterWeightComparator(boolean ascending, boolean dups)
           
 
Method Summary
 int compare(FeatureCluster fc1, FeatureCluster fc2)
          Compares two weighted features by their weights.
 boolean equals(java.lang.Object o)
          Tests whether this comparator is equal to another.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ascending

protected boolean ascending

dups

protected boolean dups
Constructor Detail

ClusterWeightComparator

public ClusterWeightComparator()

ClusterWeightComparator

public ClusterWeightComparator(boolean ascending)

ClusterWeightComparator

public ClusterWeightComparator(boolean ascending,
                               boolean dups)
Method Detail

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 cluster
fc2 - 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.