Code example for AttributedString

Methods: addAttributegetIterator

0
                3); 
        AttributedCharacterIterator it = as.getIterator(); 
        assertEquals("non-null value limit", 2, it 
                .getRunLimit(AttributedCharacterIterator.Attribute.LANGUAGE)); 
 
        as = new AttributedString("test"); 
        as.addAttribute(AttributedCharacterIterator.Attribute.LANGUAGE, null, 
                2, 3); 
        it = as.getIterator(); 
        assertEquals("null value limit", 4, it 
                .getRunLimit(AttributedCharacterIterator.Attribute.LANGUAGE)); 
 
        try { 
            as = new AttributedString("test"); 
            as.addAttribute(AttributedCharacterIterator.Attribute.LANGUAGE, 
                    null, -1, 3); 
            fail("Expected IllegalArgumentException"); 
        } catch (IllegalArgumentException e) { 
            // Expected 
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE