Package java.text

Examples of java.text.StringCharacterIterator.first()


        StringBuffer bs = new StringBuffer(to_process.length() + 50);
        StringCharacterIterator sci = new StringCharacterIterator(to_process);
        String path = System.getProperty("path.separator");
        String file = System.getProperty("file.separator");
        String tmp = null;
        for (char c = sci.first(); c != CharacterIterator.DONE; c = sci.next()) {
            tmp = String.valueOf(c);
           
            if (tmp.equals(":") || tmp.equals(";"))
                tmp = path;
            else if (tmp.equals("/") || tmp.equals ("\\"))
View Full Code Here


        }

        path = path.replace('\\', '/');

        CharacterIterator iter = new StringCharacterIterator(path);
        for (char c = iter.first(); c != CharacterIterator.DONE;
             c = iter.next()) {
            if (c < 256 && isSpecial[c]) {
                sb.append('%');
                sb.append(escapedChar1[c]);
                sb.append(escapedChar2[c]);
View Full Code Here

            uri = uri.substring(1);
        }

        StringBuffer sb = new StringBuffer();
        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, 16);
View Full Code Here

   * </ul>
   */
  static String escapeText(String input) {
    StringBuilder builder = new StringBuilder(input.length());
    CharacterIterator iter = new StringCharacterIterator(input);
    for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
      switch(c) {
        case '\b':
          builder.append("\\b");
          break;
        case '\f':
View Full Code Here

      harness.check (sci.getIndex (), idx);
      harness.check (sci.next (), CharacterIterator.DONE);
      harness.check (sci.current (), CharacterIterator.DONE);
      harness.check (sci.getIndex (), recherche.length ());

      harness.check (sci.first (), 'r');
      harness.check (sci.getIndex (), 0);

      harness.checkPoint ("full iteration");
      for (int i = 0; i < recherche.length () - 1; ++i)
  harness.check (sci.next (), recherche.charAt (i + 1));
View Full Code Here

            return encodedText;
        }
        StringBuilder sb = new StringBuilder();
        char[] digits = new char[4];
        CharacterIterator iter = new StringCharacterIterator(encodedText);
        for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
            if (c == '_') {
                // Read the next character, if there is one ...
                char next = iter.next();
                if (next == CharacterIterator.DONE) {
                    sb.append(c);
View Full Code Here

        if (text == null) return null;
        if (text.length() == 0) return text;
        StringBuilder sb = new StringBuilder();
        String hex = null;
        CharacterIterator iter = new StringCharacterIterator(text);
        for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
            if (c == '_') {
                // Read the next character (if there is one) ...
                char next = iter.next();
                if (next == CharacterIterator.DONE) {
                    sb.append(c);
View Full Code Here

     */
    public String encode( String text ) {
        if (text == null) return null;
        StringBuilder sb = new StringBuilder();
        CharacterIterator iter = new StringCharacterIterator(text);
        for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
            switch (c) {
                case '&':
                    sb.append("&amp;");
                    break;
                case '"':
View Full Code Here

     */
    public String decode( String encodedText ) {
        if (encodedText == null) return null;
        StringBuilder sb = new StringBuilder();
        CharacterIterator iter = new StringCharacterIterator(encodedText);
        for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
            if (c == '&') {
                int index = iter.getIndex();
               
                do {
                    c = iter.next();
View Full Code Here

     */
    public String encode( String publicName ) {
        if (publicName == null) return null;
        StringBuilder sb = new StringBuilder();
        CharacterIterator iter = new StringCharacterIterator(publicName);
        for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
            char mapped = c;
            if (c == '*') {
                mapped = '\uF02A';
            } else if (c == '/') {
                mapped = '\uF02F';
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.