Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.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 HashPrintServiceAttributeSet} provides an attribute set which32* inherits its implementation from class33* {@link HashAttributeSet HashAttributeSet} and enforces the semantic34* restrictions of interface35* {@link PrintServiceAttributeSet PrintServiceAttributeSet}.36*37* @author Alan Kaminsky38*/39public class HashPrintServiceAttributeSet extends HashAttributeSet40implements PrintServiceAttributeSet, Serializable {4142/**43* Use serialVersionUID from JDK 1.4 for interoperability.44*/45@Serial46private static final long serialVersionUID = 6642904616179203070L;4748/**49* Construct a new, empty hash print service attribute set.50*/51public HashPrintServiceAttributeSet() {52super (PrintServiceAttribute.class);53}5455/**56* Construct a new hash print service attribute set, initially populated57* with the given value.58*59* @param attribute attribute value to add to the set60* @throws NullPointerException if {@code attribute} is {@code null}61*/62public HashPrintServiceAttributeSet(PrintServiceAttribute attribute) {63super (attribute, PrintServiceAttribute.class);64}6566/**67* Construct a new print service attribute set, initially populated with the68* values from the given array. The new attribute set is populated by adding69* the elements of {@code attributes} array to the set in sequence, starting70* at index 0. Thus, later array elements may replace earlier array elements71* if the array contains duplicate attribute values or attribute 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 HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) {79super (attributes, PrintServiceAttribute.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 PrintServiceAttribute} 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 PrintServiceAttribute}91*/92public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes)93{94super(attributes, PrintServiceAttribute.class);95}96}979899