public void sortByWeight(String[] attributeNames,int direction,int comparatorType){
  Arrays.sort(attributeNames,new WeightComparator(direction,comparatorType));
}

public void sortByWeight ( String [ ] attributeNames , int direction , int comparatorType ) { Arrays . sort ( attributeNames , new WeightComparator ( direction , comparatorType ) ) ; }
sorts the given array of attribute names according to their weight , the sorting direction ( ascending or descending ) , and with respect to the fact if original or absolute weights should be used . ascending means that the attributes with the smallest weights come first .
