Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.text.AttributedString

java.lang.Object
    |
    +----java.text.AttributedString

public class AttributedString
extends Object
An AttributedString holds text and related attribute information. It may be used as the actual data storage in some cases where a text reader wants to access attributed text through the AttributedCharacterIterator interface.

See Also:
AttributedCharacterIterator, Annotation

Constructor Summary
 AttributedString(String text)
Constructs an AttributedString instance with the given text.
 

Method Summary
void  addAttribute(String attributeName, int beginIndex, int endIndex, Object value)
Adds an attribute to the string.
AttributedCharacterIterator  getIterator()
Creates an AttributedCharacterIterator instance that provides access to the entire contents of this string.
AttributedCharacterIterator  getIterator(String[] attributeNames)
Creates an AttributedCharacterIterator instance that provides access to selected contents of this string.
AttributedCharacterIterator  getIterator(int beginIndex, int endIndex, String[] attributeNames)
Creates an AttributedCharacterIterator instance that provides access to selected contents of this string.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributedString

public AttributedString(String text)
Constructs an AttributedString instance with the given text.
Method Detail

addAttribute

public void addAttribute(String attributeName,
                         int beginIndex,
                         int endIndex,
                         Object value)
Adds an attribute to the string.
Parameters:
attributeName - The name of the attribute
beginIndex - Index of the first character of the range
endIndex - Index of the character following the last character of the range
value - The value of the attribute

getIterator

public AttributedCharacterIterator getIterator()
Creates an AttributedCharacterIterator instance that provides access to the entire contents of this string.
Returns:
an iterator providing access to the text and its attributes

getIterator

public AttributedCharacterIterator getIterator(String[] attributeNames)
Creates an AttributedCharacterIterator instance that provides access to selected contents of this string. Information about attributes not listed in attributeNames that the implementor may have need not be made accessible through the iterator.
Parameters:
attributeNames - A list of attributes that the client is interested in
Returns:
An iterator providing access to the text and its attributes

getIterator

public AttributedCharacterIterator getIterator(int beginIndex,
                                               int endIndex,
                                               String[] attributeNames)
Creates an AttributedCharacterIterator instance that provides access to selected contents of this string. Information about attributes not listed in attributeNames that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
Parameters:
beginIndex - the index of the first character
endIndex - the index of the character following the last character
attributeNames - a list of attributes that the client is interested in
Returns:
an iterator providing access to the text and its attributes

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.