Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java
41159 views
/*1* Copyright (c) 2000, 2021, 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.Serial;28import java.io.Serializable;2930/**31* Class {@code HashPrintJobAttributeSet} provides an attribute set which32* inherits its implementation from class33* {@link HashAttributeSet HashAttributeSet} and enforces the semantic34* restrictions of interface {@link PrintJobAttributeSet PrintJobAttributeSet}.35*36* @author Alan Kaminsky37*/38public class HashPrintJobAttributeSet extends HashAttributeSet39implements PrintJobAttributeSet, Serializable {4041/**42* Use serialVersionUID from JDK 1.4 for interoperability.43*/44@Serial45private static final long serialVersionUID = -4204473656070350348L;4647/**48* Construct a new, empty hash print job attribute set.49*/50public HashPrintJobAttributeSet() {51super(PrintJobAttribute.class);52}5354/**55* Construct a new hash print job attribute set, initially populated with56* the given value.57*58* @param attribute attribute value to add to the set59* @throws NullPointerException if {@code attribute} is {@code null}60*/61public HashPrintJobAttributeSet(PrintJobAttribute attribute) {62super(attribute, PrintJobAttribute.class);63}6465/**66* Construct a new hash print job attribute set, initially populated with67* the values from the given array. The new attribute set is populated by68* adding the elements of {@code attributes} array to the set in sequence,69* starting at index 0. Thus, later array elements may replace earlier array70* elements if the array contains duplicate attribute values or attribute71* categories.72*73* @param attributes array of attribute values to add to the set. If74* {@code null}, an empty attribute set is constructed.75* @throws NullPointerException if any element of {@code attributes} is76* {@code null}77*/78public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) {79super (attributes, PrintJobAttribute.class);80}8182/**83* Construct a new attribute set, initially populated with the values from84* the given set where the members of the attribute set are restricted to85* the {@code PrintJobAttribute} interface.86*87* @param attributes set of attribute values to initialise the set. If88* {@code null}, an empty attribute set is constructed.89* @throws ClassCastException if any element of {@code attributes} is not an90* instance of {@code PrintJobAttribute}91*/92public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) {93super(attributes, PrintJobAttribute.class);94}95}969798