@Override public int compareTo(ConstraintFactory o) { if (o instanceof AbstractConstraintFactory) { // We have no particular preference, so defer to other int otherPref = ((AbstractConstraintFactory) o).internalCompare(this); if (otherPref == 0) { // Other also has no preference. We came first, so we stay first return this.equals(o) ? 0 : -1; } // Defer to other return otherPref * -1; } return -1; }
@Override public int compareTo(ConstraintFactory o) { if (o instanceof AbstractConstraintFactory) { // We have no particular preference, so defer to other int otherPref = ((AbstractConstraintFactory) o).internalCompare(this); if (otherPref == 0) { // Other also has no preference. We came first, so we stay first return this.equals(o) ? 0 : -1; } // Defer to other return otherPref * -1; } return -1; }
@Override public int compareTo(ConstraintFactory o) { if (o instanceof AbstractConstraintFactory) { // We have no particular preference, so defer to other int otherPref = ((AbstractConstraintFactory) o).internalCompare(this); if (otherPref == 0) { // Other also has no preference. We came first, so we stay first return this.equals(o) ? 0 : -1; } // Defer to other return otherPref * -1; } return -1; }