src/share/classes/javax/print/attribute/HashAttributeSet.java

Print this page




 365             category != null &&
 366             AttributeSetUtilities.
 367             verifyAttributeCategory(category, Attribute.class) != null &&
 368             attrMap.get(category) != null;
 369     }
 370 
 371     /**
 372      * Returns <tt>true</tt> if this attribute set contains the given
 373      * attribute.
 374      *
 375      * @param  attribute  value whose presence in this attribute set is
 376      *            to be tested.
 377      *
 378      * @return  <tt>true</tt> if this attribute set contains the given
 379      *      attribute    value.
 380      */
 381     public boolean containsValue(Attribute attribute) {
 382         return
 383            attribute != null &&
 384            attribute instanceof Attribute &&
 385            attribute.equals(attrMap.get(((Attribute)attribute).getCategory()));
 386     }
 387 
 388     /**
 389      * Adds all of the elements in the specified set to this attribute.
 390      * The outcome is the same as if the
 391      * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
 392      * operation had been applied to this attribute set successively with
 393      * each element from the specified set.
 394      * The behavior of the <CODE>addAll(AttributeSet)</CODE>
 395      * operation is unspecified if the specified set is modified while
 396      * the operation is in progress.
 397      * <P>
 398      * If the <CODE>addAll(AttributeSet)</CODE> operation throws an exception,
 399      * the effect on this attribute set's state is implementation dependent;
 400      * elements from the specified set before the point of the exception may
 401      * or may not have been added to this attribute set.
 402      *
 403      * @param  attributes  whose elements are to be added to this attribute
 404      *            set.
 405      *




 365             category != null &&
 366             AttributeSetUtilities.
 367             verifyAttributeCategory(category, Attribute.class) != null &&
 368             attrMap.get(category) != null;
 369     }
 370 
 371     /**
 372      * Returns <tt>true</tt> if this attribute set contains the given
 373      * attribute.
 374      *
 375      * @param  attribute  value whose presence in this attribute set is
 376      *            to be tested.
 377      *
 378      * @return  <tt>true</tt> if this attribute set contains the given
 379      *      attribute    value.
 380      */
 381     public boolean containsValue(Attribute attribute) {
 382         return
 383            attribute != null &&
 384            attribute instanceof Attribute &&
 385            attribute.equals(attrMap.get(attribute.getCategory()));
 386     }
 387 
 388     /**
 389      * Adds all of the elements in the specified set to this attribute.
 390      * The outcome is the same as if the
 391      * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
 392      * operation had been applied to this attribute set successively with
 393      * each element from the specified set.
 394      * The behavior of the <CODE>addAll(AttributeSet)</CODE>
 395      * operation is unspecified if the specified set is modified while
 396      * the operation is in progress.
 397      * <P>
 398      * If the <CODE>addAll(AttributeSet)</CODE> operation throws an exception,
 399      * the effect on this attribute set's state is implementation dependent;
 400      * elements from the specified set before the point of the exception may
 401      * or may not have been added to this attribute set.
 402      *
 403      * @param  attributes  whose elements are to be added to this attribute
 404      *            set.
 405      *