+2003-12-23 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/AttributeSetUtilities.java
+ (verifyCategoryForValue): Renamed from verifyCategoryForAttribute.
+ * javax/print/attribute/HashAttributeSet.java
+ (HashAttributeSet): Call internal add methods, added missing
+ exceptions.
+ (add): Call addInternal, added exceptions to documentation.
+ (addInternal): New method.
+ (addAll): Call addAllInternal, added exception to documentation.
+ (addAllInternal): New method.
+ (clear): Added exception to documentation.
+ (remove): Likewise.
+ * javax/print/attribute/URISyntax.java
+ (serialVersionUID): Fixed value.
+
2003-12-22 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
if (attribute == null)
throw new NullPointerException();
- add(attribute);
+ addInternal(attribute, interfaceName);
}
/**
throw new NullPointerException();
for (int index = 0; index < attributes.length; index++)
- add(attributes[index]);
+ addInternal(attributes[index], interfaceName);
}
/**
*
* @exception ClassCastException if any element of attributes is not an
* interface of interfaceName
- * @exception NullPointerException if attributes or interfaceName is null
*/
public HashAttributeSet(AttributeSet attributes, Class interfaceName)
{
this(interfaceName);
if (attributes != null)
- addAll(attributes);
+ addAllInternal(attributes, interfaceName);
}
/**
* @param attribute the attribute to add
*
* @return true if the attribute set has changed, false otherwise
+ *
+ * @exception NullPointerException if attribute is null
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
*/
public boolean add(Attribute attribute)
+ {
+ return addInternal(attribute, interfaceName);
+ }
+
+ private boolean addInternal(Attribute attribute, Class interfaceName)
{
if (attribute == null)
throw new NullPointerException("attribute may not be null");
+ AttributeSetUtilities.verifyAttributeCategory(interfaceName,
+ this.interfaceName);
+
Object old = attributeMap.put
(attribute.getCategory(), AttributeSetUtilities.verifyAttributeValue
(attribute, interfaceName));
* @param attributes the attributes to add
*
* @return true if the attribute set has changed, false otherwise
+ *
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
*/
public boolean addAll(AttributeSet attributes)
+ {
+ return addAllInternal(attributes, interfaceName);
+ }
+
+ private boolean addAllInternal(AttributeSet attributes, Class interfaceName)
{
boolean modified = false;
Attribute[] array = attributes.toArray();
for (int index = 0; index < array.length; index++)
- if (! add(array[index]))
+ if (addInternal(array[index], interfaceName))
modified = true;
return modified;
/**
* Removes all attributes from this attribute set.
+ *
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
*/
public void clear()
{
* @param attribute the attribute value of the entry to be removed
*
* @return true if the attribute set has changed, false otherwise.
+ *
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
*/
public boolean remove(Attribute attribute)
{