private final int[] getFirstCaseDiff(final String text, final String pattern, final Locale locale){ final CollationElementIterator targIter = m_collator.getCollationElementIterator(text); final CollationElementIterator patIter = m_collator.getCollationElementIterator(pattern); int startTarg = -1; int endTarg = -1;
/** * Test whether one string contains another, according to the rules * of the XPath contains() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 contains s2 */ public boolean contains(String s1, String s2) { CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, false); }
/** * Test whether one string starts with another, according to the rules * of the XPath starts-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 starts with s2 */ public boolean startsWith(String s1, String s2) { CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationStartsWith(iter1, iter2); }
/** * Test whether one string ends with another, according to the rules * of the XPath ends-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 ends with s2 */ public boolean endsWith(String s1, String s2) { CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, true); }
/** * Test whether one string ends with another, according to the rules * of the XPath ends-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 ends with s2 */ public boolean endsWith(String s1, String s2) { CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, true); }
/** * Test whether one string starts with another, according to the rules * of the XPath starts-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 starts with s2 */ public boolean startsWith(String s1, String s2) { CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationStartsWith(iter1, iter2); }
/** * Test whether one string contains another, according to the rules * of the XPath contains() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 contains s2 */ public boolean contains(String s1, String s2) { CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, false); }
/** * Test whether one string ends with another, according to the rules * of the XPath ends-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 ends with s2 */ public boolean endsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, true); }
/** * Test whether one string contains another, according to the rules * of the XPath contains() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 contains s2 */ public boolean contains(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, false); }
/** * Test whether one string ends with another, according to the rules * of the XPath ends-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 ends with s2 */ public boolean endsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, true); }
/** * Test whether one string contains another, according to the rules * of the XPath contains() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 contains s2 */ public boolean contains(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, false); }
/** * Test whether one string starts with another, according to the rules * of the XPath starts-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 starts with s2 */ public boolean startsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationStartsWith(iter1, iter2); }
/** * Test whether one string starts with another, according to the rules * of the XPath starts-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 starts with s2 */ public boolean startsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationStartsWith(iter1, iter2); }
/** * Test whether one string contains another, according to the rules * of the XPath contains() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 contains s2 */ public boolean contains(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, false); }
/** * Test whether one string contains another, according to the rules * of the XPath contains() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 contains s2 */ public boolean contains(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, false); }
/** * Test whether one string ends with another, according to the rules * of the XPath ends-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 ends with s2 */ public boolean endsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, true); }
/** * Test whether one string starts with another, according to the rules * of the XPath starts-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 starts with s2 */ public boolean startsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationStartsWith(iter1, iter2); }
/** * Test whether one string starts with another, according to the rules * of the XPath starts-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 starts with s2 */ public boolean startsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationStartsWith(iter1, iter2); }
/** * Test whether one string ends with another, according to the rules * of the XPath ends-with() function * * @param s1 the containing string * @param s2 the contained string * @return true iff s1 ends with s2 */ public boolean endsWith(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); return collationContains(iter1, iter2, null, true); }
/** * Return the part of a string before a given substring, according to the rules * of the XPath substring-before() function * * @param s1 the containing string * @param s2 the contained string * @return the part of s1 that precedes the first occurrence of s2 */ public String substringBefore(String s1, String s2) { RuleBasedCollator collator = getRuleBasedCollator(); CollationElementIterator iter1 = collator.getCollationElementIterator(s1); CollationElementIterator iter2 = collator.getCollationElementIterator(s2); int[] ib = new int[2]; boolean bb = collationContains(iter1, iter2, ib, false); if (bb) { return s1.substring(0, ib[0]); } else { return ""; } }