/[classpath]/classpath/javax/swing/text/SimpleAttributeSet.java
ViewVC logotype

Diff of /classpath/javax/swing/text/SimpleAttributeSet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by mark, Sat Jul 2 20:32:51 2005 UTC revision 1.10 by rabbit78, Tue Sep 13 23:44:50 2005 UTC
# Line 45  import java.util.Hashtable; Line 45  import java.util.Hashtable;
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;
# Line 89  public class SimpleAttributeSet Line 92  public class SimpleAttributeSet
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();
# Line 110  public class SimpleAttributeSet Line 113  public class SimpleAttributeSet
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)
# Line 160  public class SimpleAttributeSet Line 163  public class SimpleAttributeSet
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)

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26