/** * Create an GenericAtomicComparer * @param collator the collation to be used. If the method is called at compile time, this should * be a NamedCollation so that it can be cloned at run-time. * @param platform used to obtain collation keys. */ public CollatingAtomicComparer(StringCollator collator, Platform platform) { if (collator == null) { this.collator = CodepointCollator.getInstance(); collationURI = NamespaceConstant.CODEPOINT_COLLATION_URI; } else { this.collator = collator; collationURI = "*unknown*"; } canReturnCollationKeys = platform.canReturnCollationKeys(this.collator); }
/** * Create an GenericAtomicComparer * @param collator the collation to be used. If the method is called at compile time, this should * be a NamedCollation so that it can be cloned at run-time. * @param platform used to obtain collation keys. */ public CollatingAtomicComparer(StringCollator collator, Platform platform) { if (collator == null) { this.collator = CodepointCollator.getInstance(); collationURI = NamespaceConstant.CODEPOINT_COLLATION_URI; } else { this.collator = collator; collationURI = "*unknown*"; } canReturnCollationKeys = platform.canReturnCollationKeys(this.collator); }
/** * Get a comparison key for an object. This must satisfy the rule that if two objects are equal, * then their comparison keys are equal, and vice versa. There is no requirement that the * comparison keys should reflect the ordering of the underlying objects. */ public ComparisonKey getComparisonKey(AtomicValue a) { if (a instanceof StringValue) { Platform platform = Configuration.getPlatform(); if (platform.canReturnCollationKeys(collator)) { return new ComparisonKey(StandardNames.XS_STRING, collator.getCollationKey(a.getStringValue())); } else { return new ComparisonKey(StandardNames.XS_STRING, a.getStringValue()); } } else { return new ComparisonKey(StandardNames.XS_STRING, a); } }
/** * Get a comparison key for an object. This must satisfy the rule that if two objects are equal, * then their comparison keys are equal, and vice versa. There is no requirement that the * comparison keys should reflect the ordering of the underlying objects. */ public ComparisonKey getComparisonKey(AtomicValue a) { if (a instanceof StringValue) { Platform platform = Configuration.getPlatform(); if (platform.canReturnCollationKeys(collator)) { return new ComparisonKey(StandardNames.XS_STRING, collator.getCollationKey(a.getStringValue())); } else { return new ComparisonKey(StandardNames.XS_STRING, a.getStringValue()); } } else { return new ComparisonKey(StandardNames.XS_STRING, a); } }
if (platform.canReturnCollationKeys(collator)) { return new ComparisonKey(StandardNames.XS_STRING, collator.getCollationKey(a.getStringValue()));
if (platform.canReturnCollationKeys(collator)) { return new ComparisonKey(StandardNames.XS_STRING, collator.getCollationKey(a.getStringValue()));
collationName = null; } else if (!Configuration.getPlatform().canReturnCollationKeys(collator)) { compileError("The collation used for xsl:key must be capable of generating collation keys", "XTSE1210");
collationName = null; } else if (!Configuration.getPlatform().canReturnCollationKeys(collator)) { compileError("The collation used for xsl:key must be capable of generating collation keys", "XTSE1210");
collationName = null; } else if (!Version.platform.canReturnCollationKeys(collator)) { compileError("The collation used for xsl:key must be capable of generating collation keys", "XTSE1210");
collationName = null; } else if (!Version.platform.canReturnCollationKeys(collator)) { compileError("The collation used for xsl:key must be capable of generating collation keys", "XTSE1210");