@Override public int compareTo(AttributeWeight o){
  double w1=weight;
  double w2=o.weight;
  assert (weights == o.weights);
  if (weights.getWeightType() == AttributeWeights.ABSOLUTE_WEIGHTS) {
    w1=Math.abs(w1);
    w2=Math.abs(w2);
  }
  return Double.compare(w1,w2) * weights.getSortingType();
}

@ Override public int compareTo ( AttributeWeight o ) { double w1 = weight ; double w2 = o . weight ; assert ( weights == o . weights ) ; if ( weights . getWeightType ( ) == AttributeWeights . ABSOLUTE_WEIGHTS ) { w1 = Math . abs ( w1 ) ; w2 = Math . abs ( w2 ) ; } return Double . compare ( w1 , w2 ) * weights . getSortingType ( ) ; }
compares the weight of this object with the weight of another attributeweight object . may also use the absolute weight .
