From 2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 17 Jan 2006 18:09:40 +0000 Subject: Imported GNU Classpath 0.20 * Makefile.am (AM_CPPFLAGS): Add classpath/include. * java/nio/charset/spi/CharsetProvider.java: New override file. * java/security/Security.java: Likewise. * sources.am: Regenerated. * Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109831 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../attribute/standard/NumberUpSupported.java | 62 +++++++++++++++++++--- 1 file changed, 56 insertions(+), 6 deletions(-) (limited to 'libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java') diff --git a/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java b/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java index 512bdaa00c7..71392a9ef52 100644 --- a/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java +++ b/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java @@ -1,5 +1,5 @@ /* NumberUpSupported.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -42,7 +42,15 @@ import javax.print.attribute.SupportedValuesAttribute; /** + * The NumberUpSupported printing attribute specifies the + * supported value or range of values for the + * {@link javax.print.attribute.standard.NumberUp} attribute. + *

+ * IPP Compatibility: NumberUpSupported is an IPP 1.1 attribute. + *

+ * * @author Michael Koch (konqueror@gmx.de) + * @author Wolfgang Baer (WBaer@gmx.de) */ public final class NumberUpSupported extends SetOfIntegerSyntax implements SupportedValuesAttribute @@ -50,33 +58,75 @@ public final class NumberUpSupported extends SetOfIntegerSyntax private static final long serialVersionUID = -1041573395759141805L; /** - * Constructs a NumberUp object. + * Constructs a NumberUpSupported object. + * + * @param member the only one value supported for number up. + * + * @exception IllegalArgumentException if member is < 1 */ public NumberUpSupported(int member) { super(member); + + if (member < 1) + throw new IllegalArgumentException("member may not be less than 1"); } /** - * Constructs a NumberUp object. + * Constructs a NumberUpSupported object. + * + * @param members the members supported for number up. + * + * @exception IllegalArgumentException if any element is invalid + * @exception NullPointerException if members is null or any + * element of members is null. */ public NumberUpSupported(int[][] members) { super(members); + + if (members == null) + throw new NullPointerException("members may not be null"); } /** - * Constructs a NumberUp object. + * Constructs a NumberUpSupported object with the + * given range for supported number up values. + * + * @param lowerBound the lower bound value + * @param upperBound the upper bound value + * + * @exception IllegalArgumentException if lowerBound <= upperbound + * and lowerBound < 1 */ public NumberUpSupported(int lowerBound, int upperBound) { super(lowerBound, upperBound); + + if (lowerBound < 1) + throw new IllegalArgumentException("lowerBound may not be less than 1"); + } + + /** + * Tests if the given object is equal to this object. + * + * @param obj the object to test + * + * @return true if both objects are equal, + * false otherwise. + */ + public boolean equals(Object obj) + { + if (! (obj instanceof NumberUpSupported)) + return false; + + return super.equals(obj); } /** * Returns category of this class. * - * @return the class NumberUpSupported itself + * @return The class NumberUpSupported itself. */ public Class getCategory() { @@ -86,7 +136,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax /** * Returns the name of this attribute. * - * @return the name + * @return The name "number-up-supported". */ public String getName() { -- cgit v1.2.3