Package java.text

Examples of java.text.RuleBasedCollator$CollationElement


     * RESOLVE - unfinished LIKE test with dataset of all unicode characters
     **/
    private static final void printRuleBasedCollator()
    {
        // get en_US Collator rules
        RuleBasedCollator en_USCollator =
            (RuleBasedCollator)Collator.getInstance(Locale.US);
        String en_rules = en_USCollator.getRules();

        System.out.println("ENGLISH RULES: " + en_rules);
        System.out.println("ENGLISH RULES: " + formatString(en_rules, true));
        System.out.println("ENGLISH RULES: " + formatString(en_rules, false));
    }
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

            m_sorter = new PageSorter( HumanComparator.DEFAULT_HUMAN_COMPARATOR );
        }
        else
            try
            {
                Collator collator = new RuleBasedCollator( order );
                collator.setStrength( Collator.PRIMARY );
                m_sorter = new PageSorter( new CollatorComparator( collator ) );
            }
            catch( ParseException pe )
            {
                log.info( "Failed to parse requested collator - using default ordering", pe );
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

            // StringDataValue returned for (V AS CLOB) should consider the
            // 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.
            try {
                RuleBasedCollator rbs = ConnectionUtil.getCurrentLCC().getDataValueFactory().
                getCharacterCollator(targetCollationType);
                result = ((StringDataValue)result).getValue(rbs);
            }
            catch( java.sql.SQLException sqle)
            {
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

    //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

      if (!localeFound)
      throw StandardException.newException(
          SQLState.COLLATOR_NOT_FOUND_FOR_LOCALE,
          databaseLocale.toString());
     
      RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance(databaseLocale);

    if (strength != -1)
      collator.setStrength(strength);

    return collator;
    }
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 = getLocaleFinder().getCollator();   
    cKey = rbc.getCollationKey(new String(rawData, 0, lastNonspaceChar));

    return cKey;
  }
View Full Code Here

TOP

Related Classes of java.text.RuleBasedCollator$CollationElement

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.