Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.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 HashDocAttributeSet provides an attribute set which32* inherits its implementation from class {@link HashAttributeSet33* HashAttributeSet} and enforces the semantic restrictions of interface {@link34* DocAttributeSet DocAttributeSet}.35* <P>36*37* @author Alan Kaminsky38*/39public class HashDocAttributeSet extends HashAttributeSet40implements DocAttributeSet, Serializable {4142private static final long serialVersionUID = -1128534486061432528L;4344/**45* Construct a new, empty hash doc attribute set.46*/47public HashDocAttributeSet() {48super (DocAttribute.class);49}5051/**52* Construct a new hash doc 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 HashDocAttributeSet(DocAttribute attribute) {61super (attribute, DocAttribute.class);62}6364/**65* Construct a new hash doc attribute set,66* initially populated with the values from the given array.67* The new attribute set is populated by68* 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 NullPointerException77* (unchecked exception)78* Thrown if any element of <CODE>attributes</CODE> is null.79*/80public HashDocAttributeSet(DocAttribute[] attributes) {81super (attributes, DocAttribute.class);82}8384/**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>DocAttribute</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>DocAttribute</CODE>.96*/97public HashDocAttributeSet(DocAttributeSet attributes) {98super(attributes, DocAttribute.class);99}100101}102103104