source: trunk/src/gcc/libjava/java/text/AttributedCharacterIterator.java@ 608

Last change on this file since 608 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 9.8 KB
Line 
1/* AttributedCharacterIterator.java -- Iterate over attributes
2 Copyright (C) 1998, 1999 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38
39package java.text;
40
41import java.io.Serializable;
42import java.io.InvalidObjectException;
43import java.util.Set;
44import java.util.Map;
45
46/**
47 * This interface extends the <code>CharacterIterator</code> interface
48 * in order to support iteration over character attributes as well as
49 * over the characters themselves.
50 * <p>
51 * In addition to attributes of specific characters, this interface
52 * supports the concept of the "attribute run", which is an attribute
53 * that is defined for a particular value across an entire range of
54 * characters or which is undefined over a range of characters.
55 *
56 * @version 0.0
57 *
58 * @author Aaron M. Renn ([email protected])
59 */
60public interface AttributedCharacterIterator extends CharacterIterator
61{
62
63/*
64 * Inner Classes
65 */
66
67/**
68 * This class defines attribute keys that are used as text attributes.
69 */
70public static class Attribute implements Serializable
71{
72
73/*************************************************************************/
74
75/*
76 * Static Variables
77 */
78
79/**
80 * This is the attribute for the language of the text. The value of
81 * attributes of this key type are instances of <code>Locale</code>.
82 */
83public static final Attribute LANGUAGE = new Attribute("LANGUAGE");
84
85/**
86 * This is the attribute for the reading form of text. This is used
87 * for storing pronunciation along with the written text for languages
88 * which need it. The value of attributes of this key type are
89 * instances of <code>Annotation</code> which wrappers a <code>String</code>.
90 */
91public static final Attribute READING = new Attribute("READING");
92
93/**
94 * This is the attribute for input method segments. The value of attributes
95 * of this key type are instances of <code>Annotation</code> which wrapper
96 * a <code>String</code>.
97 */
98public static final Attribute INPUT_METHOD_SEGMENT =
99 new Attribute("INPUT_METHOD_SEGMENT");
100
101/*************************************************************************/
102
103/*
104 * Instance Variables
105 */
106
107/**
108 * This is the name of the attribute key
109 * @serial
110 */
111private String name;
112
113/*************************************************************************/
114
115/*
116 * Constructors
117 */
118
119/**
120 * This method initializes a new instance of this class with the specified
121 * name.
122 *
123 * @param name The name of this attribute key.
124 */
125protected
126Attribute(String name)
127{
128 this.name = name;
129}
130
131/*************************************************************************/
132
133/*
134 * Instance Methods
135 */
136
137/**
138 * This method returns the name of this attribute.
139 *
140 * @return The attribute name