Java Doc for AttributedString.java in  » 6.0-JDK-Core » text » java » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » text » java.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.text.AttributedString

AttributedString
public class AttributedString (Code)
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.

An attribute is a key/value pair, identified by the key. No two attributes on a given character can have the same key.

The values for an attribute are immutable, or must not be mutated by clients or storage. They are always passed by reference, and not cloned.
See Also:   AttributedCharacterIterator
See Also:   Annotation
since:
   1.2



Field Summary
 intrunArraySize
    
 VectorrunAttributeValues
    
 VectorrunAttributes
    
 intrunCount
    
 intrunStarts
    
 Stringtext
    

Constructor Summary
 AttributedString(AttributedCharacterIterator[] iterators)
     Constructs an AttributedString instance with the given AttributedCharacterIterators.
public  AttributedString(String text)
     Constructs an AttributedString instance with the given text.
public  AttributedString(String text, Map<? extends Attribute, ?> attributes)
     Constructs an AttributedString instance with the given text and attributes.
public  AttributedString(AttributedCharacterIterator text)
     Constructs an AttributedString instance with the given attributed text represented by AttributedCharacterIterator.
public  AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex)
     Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator.
public  AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex, Attribute[] attributes)
     Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator.

Method Summary
public  voidaddAttribute(Attribute attribute, Object value)
     Adds an attribute to the entire string.
public  voidaddAttribute(Attribute attribute, Object value, int beginIndex, int endIndex)
     Adds an attribute to a subrange of the string.
Parameters:
  attribute - the attribute key
Parameters:
  value - The value of the attribute.
public  voidaddAttributes(Map<? extends Attribute, ?> attributes, int beginIndex, int endIndex)
     Adds a set of attributes to a subrange of the string.
public  AttributedCharacterIteratorgetIterator()
     Creates an AttributedCharacterIterator instance that provides access to the entire contents of this string.
public  AttributedCharacterIteratorgetIterator(Attribute[] attributes)
     Creates an AttributedCharacterIterator instance that provides access to selected contents of this string.
public  AttributedCharacterIteratorgetIterator(Attribute[] attributes, int beginIndex, int endIndex)
     Creates an AttributedCharacterIterator instance that provides access to selected contents of this string.
 intlength()
    

Field Detail
runArraySize
int runArraySize(Code)



runAttributeValues
Vector runAttributeValues(Code)



runAttributes
Vector runAttributes(Code)



runCount
int runCount(Code)



runStarts
int runStarts(Code)



text
String text(Code)




Constructor Detail
AttributedString
AttributedString(AttributedCharacterIterator[] iterators)(Code)
Constructs an AttributedString instance with the given AttributedCharacterIterators.
Parameters:
  iterators - AttributedCharacterIterators to constructAttributedString from.
throws:
  NullPointerException - if iterators is null



AttributedString
public AttributedString(String text)(Code)
Constructs an AttributedString instance with the given text.
Parameters:
  text - The text for this attributed string.
exception:
  NullPointerException - if text is null.



AttributedString
public AttributedString(String text, Map<? extends Attribute, ?> attributes)(Code)
Constructs an AttributedString instance with the given text and attributes.
Parameters:
  text - The text for this attributed string.
Parameters:
  attributes - The attributes that apply to the entire string.
exception:
  NullPointerException - if text orattributes is null.
exception:
  IllegalArgumentException - if the text has length 0and the attributes parameter is not an empty Map (attributescannot be applied to a 0-length range).



AttributedString
public AttributedString(AttributedCharacterIterator text)(Code)
Constructs an AttributedString instance with the given attributed text represented by AttributedCharacterIterator.
Parameters:
  text - The text for this attributed string.
exception:
  NullPointerException - if text is null.



AttributedString
public AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex)(Code)
Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator. If the given range produces an empty text, all attributes will be discarded. Note that any attributes wrapped by an Annotation object are discarded for a subrange of the original attribute range.
Parameters:
  text - The text for this attributed string.
Parameters:
  beginIndex - Index of the first character of the range.
Parameters:
  endIndex - Index of the character following the last characterof the range.
exception:
  NullPointerException - if text is null.
exception:
  IllegalArgumentException - if the subrange given bybeginIndex and endIndex is out of the text range.
See Also:   java.text.Annotation



AttributedString
public AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex, Attribute[] attributes)(Code)
Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator. Only attributes that match the given attributes will be incorporated into the instance. If the given range produces an empty text, all attributes will be discarded. Note that any attributes wrapped by an Annotation object are discarded for a subrange of the original attribute range.
Parameters:
  text - The text for this attributed string.
Parameters:
  beginIndex - Index of the first character of the range.
Parameters:
  endIndex - Index of the character following the last characterof the range.
Parameters:
  attributes - Specifies attributes to be extractedfrom the text. If null is specified, all available attributes willbe used.
exception:
  NullPointerException - if text is null.
exception:
  IllegalArgumentException - if the subrange given bybeginIndex and endIndex is out of the text range.
See Also:   java.text.Annotation




Method Detail
addAttribute
public void addAttribute(Attribute attribute, Object value)(Code)
Adds an attribute to the entire string.
Parameters:
  attribute - the attribute key
Parameters:
  value - the value of the attribute; may be null
exception:
  NullPointerException - if attribute is null.
exception:
  IllegalArgumentException - if the AttributedString has length 0(attributes cannot be applied to a 0-length range).



addAttribute
public void addAttribute(Attribute attribute, Object value, int beginIndex, int endIndex)(Code)
Adds an attribute to a subrange of the string.
Parameters:
  attribute - the attribute key
Parameters:
  value - The value of the attribute. May be null.
Parameters:
  beginIndex - Index of the first character of the range.
Parameters:
  endIndex - Index of the character following the last character of the range.
exception:
  NullPointerException - if attribute is null.
exception:
  IllegalArgumentException - if beginIndex is less then 0, endIndex isgreater than the length of the string, or beginIndex and endIndex together don'tdefine a non-empty subrange of the string.



addAttributes
public void addAttributes(Map<? extends Attribute, ?> attributes, int beginIndex, int endIndex)(Code)
Adds a set of attributes to a subrange of the string.
Parameters:
  attributes - The attributes to be added to the string.
Parameters:
  beginIndex - Index of the first character of the range.
Parameters:
  endIndex - Index of the character following the lastcharacter of the range.
exception:
  NullPointerException - if attributes is null.
exception:
  IllegalArgumentException - if beginIndex is less then0, endIndex is greater than the length of the string, orbeginIndex and endIndex together don't define a non-emptysubrange of the string and the attributes parameter is not anempty Map.



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



getIterator
public AttributedCharacterIterator getIterator(Attribute[] attributes)(Code)
Creates an AttributedCharacterIterator instance that provides access to selected contents of this string. Information about attributes not listed in attributes 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:
  attributes - a list of attributes that the client is interested in an iterator providing access to the entire text and its selected attributes



getIterator
public AttributedCharacterIterator getIterator(Attribute[] attributes, int beginIndex, int endIndex)(Code)
Creates an AttributedCharacterIterator instance that provides access to selected contents of this string. Information about attributes not listed in attributes 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:
  attributes - a list of attributes that the client is interested in
Parameters:
  beginIndex - the index of the first character
Parameters:
  endIndex - the index of the character following the last character an iterator providing access to the text and its attributes
exception:
  IllegalArgumentException - if beginIndex is less then 0,endIndex is greater than the length of the string, or beginIndex isgreater than endIndex.



length
int length()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.