Code example for AttributedString

Methods: addAttribute

0
 
    public void test_getRunStartLAttribute() { 
        assertEquals(0, it.getRunStart(
                AttributedCharacterIterator.Attribute.LANGUAGE));
 
        AttributedString as = new AttributedString("test text");
        as.addAttribute(AttributedCharacterIterator.Attribute.LANGUAGE,
                            "GERMAN", 2, 5); 
        as.addAttribute(AttributedCharacterIterator.Attribute.READING,
                            "READ", 2, 7); 
 
        assertEquals(0, as.getIterator().getRunStart(
                AttributedCharacterIterator.Attribute.LANGUAGE));
        assertEquals(0, as.getIterator().getRunStart(
                AttributedCharacterIterator.Attribute.READING));
    } 
 
    public void test_getRunStartLjava_util_Set() { 
        AttributedString as = new AttributedString("test");
        as.addAttribute(AttributedCharacterIterator.Attribute.LANGUAGE, "a", 2,
Contextual code suggestions in your IDE  Get Codota for Java