Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / classpath / javax / swing / text / AttributeSet.java
blob01d148c067ba9008d9491d3edda9236fe33ffb98
1 /* AttributeSet.java --
2 Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 package javax.swing.text;
40 import java.util.Enumeration;
42 /**
43 * A set of attributes. An attribute has a key and a value. They typically
44 * describe features of a piece of text that make up its graphical
45 * representation.
47 * An <code>AttributeSet</code> may have a resolving parent,
48 * that is another <code>AttributeSet</code> that is searched for attribute
49 * keys that are not stored locally in this <code>AttributeSet</code>.
51 * @author original author unknown
52 * @author Roman Kennke (roman@kennke.org)
54 public interface AttributeSet
56 /**
57 * Used as keys to identify character-run attributes.
59 static interface CharacterAttribute
61 // This interface is a marker interface and has no methods.
64 /**
65 * Used as keys to identify color attributes.
67 static interface ColorAttribute
69 // This interface is a marker interface and has no methods.
72 /**
73 * Used as keys to identify font attributes.
75 static interface FontAttribute
77 // This interface is a marker interface and has no methods.
80 /**
81 * Used as keys to identify paragraph level attributes.
83 static interface ParagraphAttribute
85 // This interface is a marker interface and has no methods.
88 /**
89 * Key of the attribute that is used to describe the name of an
90 * <code>AttributeSet</code>.
92 Object NameAttribute = StyleConstants.NameAttribute;
94 /**
95 * Key of the attribute that is used to identify the resolving parent of
96 * an <code>AttributeSet</code>.
98 Object ResolveAttribute = StyleConstants.ResolveAttribute;
101 * Returns <code>true</code> if this <code>AttributeSet</code> contains
102 * an attribute with the specified <code>name</code> and <code>value</code>,
103 * <code>false</code> otherwise.
105 * @param name the name of the requested attribute
106 * @param value the value of the requested attribute
108 * @return <code>true</code> if this <code>AttributeSet</code> contains
109 * an attribute with the specified <code>name</code> and
110 * <code>value</code>, <code>false</code> otherwise
112 boolean containsAttribute(Object name, Object value);
115 * Returns <code>true</code> of this <code>AttributeSet</code> contains all
116 * of the specified <code>attributes</code>.
118 * @param attributes the requested attributes
120 * @return <code>true</code> of this <code>AttributeSet</code> contains all
121 * of the specified <code>attributes</code>
123 boolean containsAttributes(AttributeSet attributes);
126 * Creates and returns a copy of this <code>AttributeSet</code>.
128 * @return a copy of this <code>AttributeSet</code>
130 AttributeSet copyAttributes();
133 * Returns the attribute with the specified <code>key</code> or
134 * <code>null</code> if no such attribute is defined in this
135 * <code>AttributeSet</code> and its resolving parents.
137 * @param key the key of the attribute that is looked up
139 * @return the attribute with the specified <code>key</code> or
140 * <code>null</code> if no such attribute is defined in this
141 * <code>AttributeSet</code> and its resolving parents
143 Object getAttribute(Object key);
146 * Returns the number of attributes that are stored locally in this
147 * <code>AttributeSet</code>.
149 * @return the number of attributes that are stored locally in this
150 * <code>AttributeSet</code>
152 int getAttributeCount();
155 * Returns the names of the attributes that are stored in this
156 * <code>AttributeSet</code>.
158 * @return the names of the attributes that are stored in this
159 * <code>AttributeSet</code>
161 Enumeration getAttributeNames();
164 * Returns the resolving parent of this <code>AttributeSet</code>.
165 * If a key is not stored locally, then a {@link #getAttribute(Object)}
166 * request is resolved up in the resolving parent of this
167 * <code>AttributeSet</code>.
169 * @return the resolving parent of this <code>AttributeSet</code>
171 AttributeSet getResolveParent();
174 * Returns <code>true</code> if an attribute with the specified name is
175 * defined locally in this <code>AttributeSet</code>, without resolving
176 * through the resolving parents.
178 * @return <code>true</code> if an attribute with the specified name is
179 * defined locally in this <code>AttributeSet</code>
181 boolean isDefined(Object attrName);
184 * Returns <code>true</code> if all of the attributes in <code>attr</code>
185 * are equal to the attributes in this <code>AttributeSet</code>,
186 * <code>false</code> otherwise.
188 * @param attr the attributes to be compared to <code>this</code>
190 * @return <code>true</code> if all of the attributes in <code>attr</code>
191 * are equal to the attributes in this <code>AttributeSet</code>,
192 * <code>false</code> otherwise
194 boolean isEqual(AttributeSet attr);