Examples of RuleBasedCollator


Examples of java.text.RuleBasedCollator

    throw noLocale();
  }

  /** @exception StandardException  Thrown on error */
  public RuleBasedCollator getCollator() throws StandardException {
    RuleBasedCollator retval = ruleBasedCollator;

    if (retval == null) {
      if (databaseLocale != null) {
        retval = ruleBasedCollator =
          (RuleBasedCollator) Collator.getInstance(databaseLocale);
View Full Code Here

Examples of java.text.RuleBasedCollator

        while (lastNonspaceChar > 0 &&
               rawData[lastNonspaceChar - 1] == '\u0020')
            lastNonspaceChar--;         // count off the trailing spaces.

        RuleBasedCollator rbc = getCollatorForCollation();     
        cKey = rbc.getCollationKey(new String(rawData, 0, lastNonspaceChar));

        return cKey;
    }
View Full Code Here

Examples of java.text.RuleBasedCollator

  private Collator createFromRules(String fileName, ResourceLoader loader) {
    InputStream input = null;
    try {
     input = loader.openResource(fileName);
     String rules = IOUtils.toString(input, "UTF-8");
     return new RuleBasedCollator(rules);
    } catch (IOException e) {
      // io error
      throw new RuntimeException(e);
    } catch (ParseException e) {
      // invalid rules
View Full Code Here

Examples of java.text.RuleBasedCollator

    @Override
    protected Comparator<Object> getItemsComparator() {
        if (fComparator == null) {
            final Collator collator = Collator.getInstance();
            if (collator instanceof RuleBasedCollator) {
                final RuleBasedCollator rbc = (RuleBasedCollator) collator;
                final String rules = rbc.getRules();
                final String newRules = rules.replaceFirst("<\'.\'<", "<").replaceFirst(
                        "<\'_\'<", "<\'.\'<\'_\'<");
                try {
                    fCollator = new RuleBasedCollator(newRules);
                } catch (final ParseException e) {
                    ErlLogger.error(e);
                    fCollator = collator;
                }
            }
View Full Code Here

Examples of java.text.RuleBasedCollator

    while (lastNonspaceChar > 0 &&
         rawData[lastNonspaceChar - 1] == '\u0020')
      lastNonspaceChar--;      // count off the trailing spaces.

    RuleBasedCollator rbc = getLocaleFinder().getCollator();   
    cKey = rbc.getCollationKey(new String(rawData, 0, lastNonspaceChar));

    return cKey;
  }
View Full Code Here

Examples of java.text.RuleBasedCollator

      }
    }

    intArray = new int[getLength()];

    RuleBasedCollator rbc = getLocaleFinder().getCollator();
    CollationElementIterator cei = rbc.getCollationElementIterator(getString());
    int nextInt;
    while ((nextInt = cei.next()) != CollationElementIterator.NULLORDER)
    {
      /* Believe it or not, a String might have more
       * collation elements than characters.
View Full Code Here

Examples of java.text.RuleBasedCollator

    throw noLocale();
  }

  /** @exception StandardException  Thrown on error */
  public RuleBasedCollator getCollator() throws StandardException {
    RuleBasedCollator retval = ruleBasedCollator;

    if (retval == null) {
      if (databaseLocale != null) {
        retval = ruleBasedCollator =
          (RuleBasedCollator) Collator.getInstance(databaseLocale);
View Full Code Here

Examples of java.text.RuleBasedCollator

        doTest(comp);
    }


    public void testRuleComparator() {
        RuleBasedCollator comp = (RuleBasedCollator)RuleBasedCollator.getInstance();
        doTest(comp);
    }
View Full Code Here

Examples of java.text.RuleBasedCollator

    throw noLocale();
  }

  /** @exception StandardException  Thrown on error */
  public RuleBasedCollator getCollator() throws StandardException {
    RuleBasedCollator retval = ruleBasedCollator;

    if (retval == null) {
      if (databaseLocale != null) {
        retval = ruleBasedCollator =
          (RuleBasedCollator) Collator.getInstance(databaseLocale);
View Full Code Here

Examples of java.text.RuleBasedCollator

    //If we are dealing with territory based collation and returnDVD is
    //of type StringDataValue, then we need to return a StringDataValue  
    //with territory based collation.
    if (returnDVD instanceof StringDataValue) {
      try {
        RuleBasedCollator rbs = ConnectionUtil.getCurrentLCC().getDataValueFactory().
        getCharacterCollator(typeDescriptor.getCollationType());
        return ((StringDataValue)returnDVD).getValue(rbs);
      }
      catch( java.sql.SQLException sqle)
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.