45 |
public class SimpleAttributeSet |
public class SimpleAttributeSet |
46 |
implements MutableAttributeSet, Serializable, Cloneable |
implements MutableAttributeSet, Serializable, Cloneable |
47 |
{ |
{ |
48 |
|
/** The serialization UID (compatible with JDK1.5). */ |
49 |
|
private static final long serialVersionUID = 8267656273837665219L; |
50 |
|
|
51 |
public static final AttributeSet EMPTY = new SimpleAttributeSet(); |
public static final AttributeSet EMPTY = new SimpleAttributeSet(); |
52 |
|
|
53 |
Hashtable tab; |
Hashtable tab; |
92 |
return tab.containsKey(name) |
return tab.containsKey(name) |
93 |
&& tab.get(name).equals(value); |
&& tab.get(name).equals(value); |
94 |
} |
} |
95 |
|
|
96 |
public boolean containsAttributes(AttributeSet attributes) |
public boolean containsAttributes(AttributeSet attributes) |
97 |
{ |
{ |
98 |
Enumeration e = attributes.getAttributeNames(); |
Enumeration e = attributes.getAttributeNames(); |
113 |
|
|
114 |
public boolean equals(Object obj) |
public boolean equals(Object obj) |
115 |
{ |
{ |
116 |
return (obj != null) |
return |
117 |
&& (obj instanceof SimpleAttributeSet) |
(obj instanceof AttributeSet) |
118 |
&& ((SimpleAttributeSet)obj).tab.equals(this.tab); |
&& this.isEqual((AttributeSet) obj); |
119 |
} |
} |
120 |
|
|
121 |
public Object getAttribute(Object name) |
public Object getAttribute(Object name) |
163 |
|
|
164 |
public boolean isEqual(AttributeSet attr) |
public boolean isEqual(AttributeSet attr) |
165 |
{ |
{ |
166 |
return this.equals(attr); |
return attr != null |
167 |
|
&& attr.containsAttributes(this) |
168 |
|
&& this.containsAttributes(attr); |
169 |
} |
} |
170 |
|
|
171 |
public void removeAttribute(Object name) |
public void removeAttribute(Object name) |