Package java.text

Examples of java.text.CharacterIterator.first()


        if(name.equals("property")) {
            name = "element-property";
        }
       
        ci = new StringCharacterIterator(name);
        c = ci.first();
       
        // If everything is uppercase, we'll lowercase the name.
        while (c != CharacterIterator.DONE) {
            if (Character.isLowerCase(c)) {
                keepCase = true;
View Full Code Here


                break;
            }
            c = ci.next();
        }
       
        c = ci.first();
        while (c != CharacterIterator.DONE) {
            if (c == '-' || c == '_')
                up = true;
            else {
                if (up)
View Full Code Here

        boolean    up = true;
        boolean    keepCase = false;
        char    c;
       
        ci = new StringCharacterIterator(name);
        c = ci.first();
       
        // If everything is uppercase, we'll lowercase the name.
        while (c != CharacterIterator.DONE)
        {
            if (Character.isLowerCase(c))
View Full Code Here

                break;
            }
            c = ci.next();
        }
       
        c = ci.first();
        while (c != CharacterIterator.DONE)
        {
            if (c == '-' || c == '_')
                up = true;
            else
View Full Code Here

        boolean    up = true;
        boolean    keepCase = false;
        char    c;
       
        ci = new StringCharacterIterator(name);
        c = ci.first();
       
        // If everything is uppercase, we'll lowercase the name.
        while (c != CharacterIterator.DONE)
        {
            if (Character.isLowerCase(c))
View Full Code Here

                break;
            }
            c = ci.next();
        }
       
        c = ci.first();
        while (c != CharacterIterator.DONE)
        {
            if (c == '-' || c == '_')
                up = true;
            else
View Full Code Here

   * @param string text to encode
   * @return number of UTF-8 bytes required to encode
   */
  public static int utf8Length(String string) {
    CharacterIterator iter = new StringCharacterIterator(string);
    char ch = iter.first();
    int size = 0;
    while (ch != CharacterIterator.DONE) {
      if ((ch >= 0xD800) && (ch < 0xDC00)) {
        // surrogate pair?
        char trail = iter.next();
View Full Code Here

        String label = "";
        if (o instanceof CharacterIterator) {
      CharacterIterator iter = (CharacterIterator) o;
      char[] cbuff = new char[iter.getEndIndex()-iter.getBeginIndex()];
      if (cbuff.length > 0) {
          cbuff[0] = iter.first();
      }
      for (int i=1; i<cbuff.length;++i) {
          cbuff[i] = iter.next();
      }
      label = new String(cbuff);
View Full Code Here

        if (uri.indexOf('%') == -1) {
            return uri;
        }
        ByteArrayOutputStream sb = new ByteArrayOutputStream(uri.length());
        CharacterIterator iter = new StringCharacterIterator(uri);
        for (char c = iter.first(); c != CharacterIterator.DONE;
             c = iter.next()) {
            if (c == '%') {
                char c1 = iter.next();
                if (c1 != CharacterIterator.DONE) {
                    int i1 = Character.digit(c1, WORD);
View Full Code Here

            int sz = iter.getEndIndex()-iter.getBeginIndex();
            if (sz == 0) return;

            char[] cbuff = new char[sz];
            cbuff[0] = iter.first();
            for (int i=1; i<cbuff.length;++i) {
                cbuff[i] = iter.next();
            }
            final String strSel = new String(cbuff);
            // HACK: getSystemClipboard sometimes deadlocks on
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.