package iitb.con.clustering;

/**
 * @author Prathab K
 *
 */
public class ClusterNode implements Comparable {
    
    public int key;
    
    public short clusterId;
    
    public short distance;
    
    public ClusterNode() {}

    public ClusterNode(int key) {
        this.key = key;
        this.clusterId = -1;
    }
    
    public ClusterNode(int key, short clusterId) {
        this.key = key;
        this.clusterId = clusterId;
    }
    
    public int  compareTo(Object obj) {
        ClusterNode cn = (ClusterNode) obj;
        if(this.clusterId > cn.clusterId)
            return 1;
        else if(this.clusterId < cn.clusterId)
            return -1;
        else
            return 0;
    }
    public String toString() {
        return Integer.toString(key) + " - " + Short.toString(clusterId) + ", " + Short.toString(distance);
    }
}