public MovieComparator() { RuleBasedCollator defaultCollator = (RuleBasedCollator) RuleBasedCollator.getInstance(); try { // default collator ignores whitespaces // using hack from http://stackoverflow.com/questions/16567287/java-collation-ignores-space stringCollator = new RuleBasedCollator(defaultCollator.getRules().replace("<'\u005f'", "<' '<'\u005f'")); } catch (Exception e) { stringCollator = defaultCollator; } }
public TvShowComparator() { RuleBasedCollator defaultCollator = (RuleBasedCollator) RuleBasedCollator.getInstance(); try { // default collator ignores whitespaces // using hack from http://stackoverflow.com/questions/16567287/java-collation-ignores-space stringCollator = new RuleBasedCollator(defaultCollator.getRules().replace("<'\u005f'", "<' '<'\u005f'")); } catch (Exception e) { stringCollator = defaultCollator; } }
/** * Create a collation from a given collation URI * @param uri the collation URI, in the format defined in the W3C <i>Functions and Operators</i> * specification * @throws XPathException if the collation URI does not conform to the W3C rules, or if it * requires features that Saxon-HE does not support */ public UcaCollatorUsingJava(String uri) throws XPathException { this.uri = uri; uca = (RuleBasedCollator) RuleBasedCollator.getInstance(); setProps(parseProps(uri)); }
/** * Create a collation from a given collation URI * @param uri the collation URI, in the format defined in the W3C <i>Functions and Operators</i> * specification * @throws XPathException if the collation URI does not conform to the W3C rules, or if it * requires features that Saxon-HE does not support */ public UcaCollatorUsingJava(String uri) throws XPathException { this.uri = uri; uca = (RuleBasedCollator) RuleBasedCollator.getInstance(); setProps(parseProps(uri)); }