0N/A/*
2362N/A * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A
0N/Apackage javax.print.attribute;
0N/A
0N/A/**
0N/A * Interface PrintRequestAttributeSet specifies the interface for a set of
0N/A * print request attributes, i.e. printing attributes that implement interface
0N/A * {@link PrintRequestAttribute PrintRequestAttribute}.
0N/A * The client uses a PrintRequestAttributeSet to specify the settings to be
0N/A * applied to a whole print job and to all the docs in the print job.
0N/A * <P>
0N/A * PrintRequestAttributeSet is just an {@link AttributeSet AttributeSet} whose
0N/A * constructors and mutating operations guarantee an additional invariant,
0N/A * namely that all attribute values in the PrintRequestAttributeSet must be
0N/A * instances of interface {@link PrintRequestAttribute PrintRequestAttribute}.
0N/A * The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and
0N/A * {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations
0N/A * are respecified below to guarantee this additional invariant.
0N/A * <P>
0N/A *
0N/A * @author Alan Kaminsky
0N/A */
0N/Apublic interface PrintRequestAttributeSet extends AttributeSet {
0N/A
0N/A /**
0N/A * Adds the specified attribute value to this attribute set if it is not
0N/A * already present, first removing any existing value in the same
0N/A * attribute category as the specified attribute value (optional
0N/A * operation).
0N/A *
0N/A * @param attribute Attribute value to be added to this attribute set.
0N/A *
0N/A * @return <tt>true</tt> if this attribute set changed as a result of
0N/A * the call, i.e., the given attribute value was not already a
0N/A * member of this attribute set.
0N/A *
0N/A * @throws UnmodifiableSetException
0N/A * (unchecked exception) Thrown if this attribute set does not
0N/A * support the <CODE>add()</CODE> operation.
0N/A * @throws ClassCastException
0N/A * (unchecked exception) Thrown if the <CODE>attribute</CODE> is
0N/A * not an instance of interface
0N/A * {@link PrintRequestAttribute PrintRequestAttribute}.
0N/A * @throws NullPointerException
0N/A * (unchecked exception) Thrown if the <CODE>attribute</CODE> is null.
0N/A */
0N/A public boolean add(Attribute attribute);
0N/A
0N/A /**
0N/A * Adds all of the elements in the specified set to this attribute.
0N/A * The outcome is the same as if the
0N/A * {@link #add(Attribute) <CODE>add(Attribute)</CODE>}
0N/A * operation had been applied to this attribute set successively with
0N/A * each element from the specified set. If none of the categories in the
0N/A * specified set are the same as any categories in this attribute set,
0N/A * the <tt>addAll()</tt> operation effectively modifies this attribute
0N/A * set so that its value is the <i>union</i> of the two sets.
0N/A * <P>
0N/A * The behavior of the <CODE>addAll()</CODE> operation is unspecified if
0N/A * the specified set is modified while the operation is in progress.
0N/A * <P>
0N/A * If the <CODE>addAll()</CODE> operation throws an exception, the effect
0N/A * on this attribute set's state is implementation dependent; elements
0N/A * from the specified set before the point of the exception may or
0N/A * may not have been added to this attribute set.
0N/A *
0N/A * @param attributes whose elements are to be added to this attribute
0N/A * set.
0N/A *
0N/A * @return <tt>true</tt> if this attribute set changed as a result of
0N/A * the call.
0N/A *
0N/A * @throws UnmodifiableSetException
0N/A * (Unchecked exception) Thrown if this attribute set does not
0N/A * support the <tt>addAll()</tt> method.
0N/A * @throws ClassCastException
0N/A * (Unchecked exception) Thrown if some element in the specified
0N/A * set is not an instance of interface {@link PrintRequestAttribute
0N/A * PrintRequestAttribute}.
0N/A * @throws NullPointerException
0N/A * (Unchecked exception) Thrown if the specified set is null.
0N/A *
0N/A * @see #add(Attribute)
0N/A */
0N/A public boolean addAll(AttributeSet attributes);
0N/A
0N/A}