/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }
/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ @Override public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ @Override public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }
/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }
/** * Compares by (in priority order) register number, unwrapped type * (that is types not {@link TypeBearer}s, and local info. * * @param other {@code non-null;} spec to compare to * @return {@code -1..1;} standard result of comparison */ @Override public int compareTo(RegisterSpec other) { if (this.reg < other.reg) { return -1; } else if (this.reg > other.reg) { return 1; } else if (this == other) { return 0; } int compare = type.getType().compareTo(other.type.getType()); if (compare != 0) { return compare; } if (this.local == null) { return (other.local == null) ? 0 : -1; } else if (other.local == null) { return 1; } return this.local.compareTo(other.local); }
/** * Compares the contents of the given two instances for ordering. This * is a static method so as to work on arbitrary {@link TypeList} * instances. * * @param list1 {@code non-null;} one list to compare * @param list2 {@code non-null;} another list to compare * @return the order of the two lists */ public static int compareContents(TypeList list1, TypeList list2) { int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); for (int i = 0; i < size; i++) { int comparison = list1.getType(i).compareTo(list2.getType(i)); if (comparison != 0) { return comparison; } } if (size1 == size2) { return 0; } else if (size1 < size2) { return -1; } else { return 1; } }