Package java.text

Examples of java.text.RuleBasedCollator


        }
        final String pattern = secondItem.stringValue();
        if(pattern.length() == 0) {
            return BooleanValue.TRUE;
        }
        final RuleBasedCollator collator;
        if(arglen == 3) {
            Item thirdItem = argv.getItem(2);
            String collation = thirdItem.stringValue();
            Collator coll = CollationUtils.resolve(collation, dynEnv.getStaticContext());
            if(!(coll instanceof RuleBasedCollator)) {
View Full Code Here


    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

        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

            // passed collation type in determining whether we should
            // generate SQLChar vs CollatorSQLChar for instance. Keep in mind
            // that collation applies only to character string types.
        if (result instanceof StringDataValue) {
          try {
            RuleBasedCollator rbs = ConnectionUtil.getCurrentLCC().getDataValueFactory().
            getCharacterCollator(targetCollationType);
            result = ((StringDataValue)result).getValue(rbs);
          }
          catch( java.sql.SQLException sqle)
          {
View Full Code Here

    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

        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

  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

    @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

    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

      }
    }

    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

TOP

Related Classes of java.text.RuleBasedCollator

Copyright © 2018 www.massapicom. 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.