/** * Orders constructor keys by the number of parameters and then this * name. * * @param o another constructor key * @return whether the other key is greater than, less than or equal to * this key */ @Override public int compareTo(ConstructorKey o) { // order by number of params first if (n() != o.n()) { return n() > o.n() ? 1 : n() < o.n() ? -1 : 0; } // use the lexicographic order of the toString method return toString().compareTo(o.toString()); }
/** * Orders constructor keys by the number of parameters and then this * name. * * @param o another constructor key * @return whether the other key is greater than, less than or equal to * this key */ @Override public int compareTo(ConstructorKey o) { // order by number of params first if (n() != o.n()) { return n() > o.n() ? 1 : n() < o.n() ? -1 : 0; } // use the lexicographic order of the toString method return toString().compareTo(o.toString()); }