Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java
38918 views
/*1* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/242526package javax.print.attribute;2728import java.io.Serializable;2930/**31* Class HashPrintJobAttributeSet provides an attribute set32* which inherits its implementation from class {@link HashAttributeSet33* HashAttributeSet} and enforces the semantic restrictions of interface34* {@link PrintJobAttributeSet PrintJobAttributeSet}.35* <P>36*37* @author Alan Kaminsky38*/39public class HashPrintJobAttributeSet extends HashAttributeSet40implements PrintJobAttributeSet, Serializable {4142private static final long serialVersionUID = -4204473656070350348L;4344/**45* Construct a new, empty hash print job attribute set.46*/47public HashPrintJobAttributeSet() {48super(PrintJobAttribute.class);49}5051/**52* Construct a new hash print job attribute set,53* initially populated with the given value.54*55* @param attribute Attribute value to add to the set.56*57* @exception NullPointerException58* (unchecked exception) Thrown if <CODE>attribute</CODE> is null.59*/60public HashPrintJobAttributeSet(PrintJobAttribute attribute) {61super(attribute, PrintJobAttribute.class);62}6364/**65* Construct a new hash print job attribute set,66* initially populated with the values from the given array.67* The new attribute set is populated68* by adding the elements of <CODE>attributes</CODE> array to the set in69* sequence, starting at index 0. Thus, later array elements may replace70* earlier array elements if the array contains duplicate attribute71* values or attribute categories.72*73* @param attributes Array of attribute values to add to the set.74* If null, an empty attribute set is constructed.75*76* @exception NullPointerException (unchecked exception)77* Thrown if any element of <CODE>attributes</CODE> is null.78*/79public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) {80super (attributes, PrintJobAttribute.class);81}8283/**84* Construct a new attribute set, initially populated with the85* values from the given set where the members of the attribute set86* are restricted to the <code>PrintJobAttribute</code> interface.87*88* @param attributes set of attribute values to initialise the set. If89* null, an empty attribute set is constructed.90*91* @exception ClassCastException92* (unchecked exception) Thrown if any element of93* <CODE>attributes</CODE> is not an instance of94* <CODE>PrintJobAttribute</CODE>.95*/96public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) {97super(attributes, PrintJobAttribute.class);98}99}100101102