Package java.text

Examples of java.text.StringCharacterIterator.current()


    final StringBuffer result = new StringBuffer();
    final StringBuffer snippet = new StringBuffer();
    boolean isInsideTag = false;
   
    final StringCharacterIterator iterator = new StringCharacterIterator(aOriginalBody);
    char character =  iterator.current();
    while (character != CharacterIterator.DONE ){
      if (character == '<') {
        doStartTag(result, snippet, character);
        isInsideTag = true;
      }
View Full Code Here


      );
    }
   
    StringBuilder result = new StringBuilder();
    StringCharacterIterator iter = new StringCharacterIterator(aCurrencyAmount);
    char character = iter.current();
    while (character != CharacterIterator.DONE){
      if ( Character.isDigit(character) ){
        result.append(character);
      }
      else if (aDecimalSeparator.charAt(0) == character){
View Full Code Here

      String recherche = "recherche";
      StringCharacterIterator sci = new StringCharacterIterator (recherche);

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

      harness.check (sci.previous (), CharacterIterator.DONE);
      harness.check (sci.getIndex (), 0);
View Full Code Here

      int idx = recherche.length () - 1;
      harness.check (sci.setIndex (idx), 'e');
      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);
View Full Code Here

      harness.check (sci.setIndex (sci.getEndIndex ()),
         CharacterIterator.DONE);

      sci = new StringCharacterIterator ("");
      // 1.2, not 1.1.
      harness.check (sci.current (), CharacterIterator.DONE);
      harness.check (sci.previous (), CharacterIterator.DONE);
      harness.check (sci.next (), CharacterIterator.DONE);
    }
}
View Full Code Here

    }

    protected String escape(final String prefix) {
        StringBuffer buffer = new StringBuffer();
        StringCharacterIterator i = new StringCharacterIterator(prefix);
        char c = i.current();
        while (c != CharacterIterator.DONE) {
            if (shallEscape(c)) {
                buffer.append('\\');
            }
            buffer.append(c);
View Full Code Here

{

    public static String decode(String source) throws IllegalArgumentException {
        StringBuffer result = new StringBuffer();
        StringCharacterIterator sci = new StringCharacterIterator(source);
        for (char c = sci.current(); c != CharacterIterator.DONE; c = sci.next()) {
            if (c == '$') {
                c = sci.next();
                if (c != CharacterIterator.DONE) {
                    if (c == '$') {
                        result.append('$');
View Full Code Here

        if (source == null) {
            return "$e";
        }
        StringBuffer result = new StringBuffer();
        StringCharacterIterator sci = new StringCharacterIterator(source);
        for (char c = sci.current(); c != CharacterIterator.DONE; c = sci.next()) {
            if (c == '$') {
                result.append("$$");
            }
            else if (c == ',') {
                result.append("$k");
View Full Code Here

   */
  static public String forHTMLTag(String aTagFragment) {
    final StringBuffer result = new StringBuffer();

    final StringCharacterIterator iterator = new StringCharacterIterator(aTagFragment);
    char character = iterator.current();
    while (character != CharacterIterator.DONE) {
      if (character == '<') {
        result.append("&lt;");
      } else if (character == '>') {
        result.append("&gt;");
View Full Code Here

    private static String forHTMLTag(String aTagFragment) {
        final StringBuffer result = new StringBuffer();

        final StringCharacterIterator iterator = new StringCharacterIterator(aTagFragment);

        for (char character = iterator.current(); character != CharacterIterator.DONE; character = iterator.next()) {
            switch (character) {
            case '<':
                result.append("&lt;");
                break;
            case '>':
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.