/** * Compares first on ID, then on element type, then on datatype. */ public int compareTo(MetadataKey<?> other) { if (other == this) { return 0; } // If they aren't the same type, put element keys at the end. if (!(other instanceof ElementKey<?, ?>)) { return 1; } int compare = compareQName(id, other.id); if (compare != 0) { return compare; } compare = compareClass(elementType, ((ElementKey<?, ?>) other).elementType); if (compare != 0) { return compare; } return compareClass(datatype, other.datatype); }
/** * Compares first on ID, then on element type, then on datatype. */ public int compareTo(MetadataKey<?> other) { if (other == this) { return 0; } // If they aren't the same type, put element keys at the end. if (!(other instanceof ElementKey<?, ?>)) { return 1; } int compare = compareQName(id, other.id); if (compare != 0) { return compare; } compare = compareClass(elementType, ((ElementKey<?, ?>) other).elementType); if (compare != 0) { return compare; } return compareClass(datatype, other.datatype); }
/** * Compares first on ID, then on element type, then on datatype. */ public int compareTo(MetadataKey<?> other) { if (other == this) { return 0; } // If they aren't the same type, put element keys at the end. if (!(other instanceof ElementKey<?, ?>)) { return 1; } int compare = compareQName(id, other.id); if (compare != 0) { return compare; } compare = compareClass(elementType, ((ElementKey<?, ?>) other).elementType); if (compare != 0) { return compare; } return compareClass(datatype, other.datatype); }