Package java.text

Examples of java.text.StringCharacterIterator.last()


   */
  public void test_setText() {
    StringCharacterIterator fixture = new StringCharacterIterator("fixture");
    fixture.setText("fix");
    assertEquals('f', fixture.current());
    assertEquals('x', fixture.last());

    try {
      fixture.setText(null);
      fail("no null pointer");
    } catch (NullPointerException e) {
View Full Code Here


        StringCharacterIterator it1 = new StringCharacterIterator("testing", 2,
                6, 4);
    assertEquals("Wrong index 4", 4, it1.getIndex());
        it1.next();
    assertEquals("Wrong index 5", 5, it1.getIndex());
        it1.last();
    assertEquals("Wrong index 4/2", 5, it1.getIndex());
    }

    /**
     * @tests java.text.StringCharacterIterator#hashCode()
View Full Code Here

     * @tests java.text.StringCharacterIterator#last()
     */
    public void test_last() {
        StringCharacterIterator it1 = new StringCharacterIterator("testing", 2,
                6, 3);
    assertEquals("Wrong last char", 'n', it1.last());
    assertEquals("Wrong previous char", 'i', it1.previous());
        it1 = new StringCharacterIterator("testing", 2, 2, 2);
        assertTrue("Not DONE", it1.last() == CharacterIterator.DONE);
    }

View Full Code Here

        StringCharacterIterator it1 = new StringCharacterIterator("testing", 2,
                6, 3);
    assertEquals("Wrong last char", 'n', it1.last());
    assertEquals("Wrong previous char", 'i', it1.previous());
        it1 = new StringCharacterIterator("testing", 2, 2, 2);
        assertTrue("Not DONE", it1.last() == CharacterIterator.DONE);
    }

    /**
     * @tests java.text.StringCharacterIterator#setIndex(int)
     */
 
View Full Code Here

                tmp = new String();
                length++;
            }
            else if(sci.getEndIndex()-1 == sci.getIndex())
            {
                tmp = tmp+String.valueOf(sci.last());
                array[length] = tmp;
                tmp = new String();
                length++;
            }
            else
View Full Code Here

                tmp = new String();
                length++;
            }
            else if(sci.getEndIndex()-1 == sci.getIndex())
            {
                tmp = tmp+String.valueOf(sci.last());
                array[length] = tmp;
                tmp = new String();
                length++;
            }
            else
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.