Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.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*/2425package javax.print.attribute;2627import java.io.Serializable;2829/**30* Class HashPrintServiceAttributeSet provides an attribute set31* which inherits its implementation from class {@link HashAttributeSet32* HashAttributeSet} and enforces the semantic restrictions of interface33* {@link PrintServiceAttributeSet PrintServiceAttributeSet}.34* <P>35*36* @author Alan Kaminsky37*/38public class HashPrintServiceAttributeSet extends HashAttributeSet39implements PrintServiceAttributeSet, Serializable {4041private static final long serialVersionUID = 6642904616179203070L;4243/**44* Construct a new, empty hash print service attribute set.45*/46public HashPrintServiceAttributeSet() {47super (PrintServiceAttribute.class);48}495051/**52* Construct a new hash print service 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 HashPrintServiceAttributeSet(PrintServiceAttribute attribute) {61super (attribute, PrintServiceAttribute.class);62}6364/**65* Construct a new print service attribute set, initially populated with66* the values from the given array. The new attribute set is populated67* by adding the elements of <CODE>attributes</CODE> array to the set in68* sequence, starting at index 0. Thus, later array elements may replace69* earlier array elements if the array contains duplicate attribute70* values or attribute categories.71*72* @param attributes Array of attribute values to add to the set.73* If null, an empty attribute set is constructed.74*75* @exception NullPointerException76* (unchecked exception)77* Thrown if any element of <CODE>attributes</CODE> is null.78*/79public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) {80super (attributes, PrintServiceAttribute.class);81}828384/**85* Construct a new attribute set, initially populated with the86* values from the given set where the members of the attribute set87* are restricted to the <code>PrintServiceAttribute</code> interface.88*89* @param attributes set of attribute values to initialise the set. If90* null, an empty attribute set is constructed.91*92* @exception ClassCastException93* (unchecked exception) Thrown if any element of94* <CODE>attributes</CODE> is not an instance of95* <CODE>PrintServiceAttribute</CODE>.96*/97public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes)98{99super(attributes, PrintServiceAttribute.class);100}101}102103104