/** * Determine whether two primitive atomic types are comparable under the rules for GeneralComparisons * for the "=" operator (that is, untyped atomic values treated as comparable to anything) * * * @param t1 the first type to compared. * This must be a primitive atomic type as defined by {@link net.sf.saxon.type.ItemType#getPrimitiveType} * @param t2 the second type to compared. * This must be a primitive atomic type as defined by {@link net.sf.saxon.type.ItemType#getPrimitiveType} * @return true if the types are comparable, as defined by the rules of the "=" operator */ public static boolean isGenerallyComparable(UType t1, UType t2) { return t1 == UType.UNTYPED_ATOMIC || t2 == UType.UNTYPED_ATOMIC || isGuaranteedComparable(t1, t2); }
/** * Determine whether two primitive atomic types are comparable under the rules for GeneralComparisons * for the "=" operator (that is, untyped atomic values treated as comparable to anything) * * * @param t1 the first type to compared. * This must be a primitive atomic type as defined by {@link net.sf.saxon.type.ItemType#getPrimitiveType} * @param t2 the second type to compared. * This must be a primitive atomic type as defined by {@link net.sf.saxon.type.ItemType#getPrimitiveType} * @return true if the types are comparable, as defined by the rules of the "=" operator */ public static boolean isGenerallyComparable(UType t1, UType t2) { return t1 == UType.UNTYPED_ATOMIC || t2 == UType.UNTYPED_ATOMIC || isGuaranteedComparable(t1, t2); }