+2004-04-20 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/EnumSyntax.java
+ (getOffset): Made protected.
+ * javax/print/attribute/HashAttributeSet.java
+ (HashAttributeSet): Likewise.
+ * javax/print/attribute/ResolutionSyntax.java
+ (getFeedResolution): Fixed typo in exception name.
+ (getCrossFeedResolution): Likewise.
+ * javax/print/attribute/SetOfIntegerSyntax.java
+ (SetOfIntegerSyntax): Fixed HTML entities in javadoc.
+ * javax/print/attribute/TextSyntax.java
+ (TextSyntax): Handle locale correctly.
+ (hashCode): Calc better hashcode value.
+ (equals): Fixed @return tag.
+ (toString): New method.
+
2004-04-20 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileLockImpl.java
return null;
}
- public int getOffset()
+ protected int getOffset()
{
return 0;
}
* @exception ClassCastException if any element of attributes is not an
* interface of interfaceName
*/
- public HashAttributeSet(AttributeSet attributes, Class interfaceName)
+ protected HashAttributeSet(AttributeSet attributes, Class interfaceName)
{
this(interfaceName);
*
* @return the resolution
*
- * @exception IllegalArgumenException if units < 1
+ * @exception IllegalArgumentException if units < 1
*/
public int getCrossFeedResolution(int units)
{
*
* @return the resolution
*
- * @exception IllegalArgumenException if units < 1
+ * @exception IllegalArgumentException if units < 1
*/
public int getFeedResolution(int units)
{
* @param lowerBound the lower bound value
* @param upperBound the upper bound value
*
- * @exception IllegalArgumentException if lowerBound <= uppbound
- * and lowerBound < 0
+ * @exception IllegalArgumentException if lowerBound <= upperbound
+ * and lowerBound < 0
*/
protected SetOfIntegerSyntax(int lowerBound, int upperBound)
{
/* TextSyntax.java --
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
* @param value the value for this syntax
* @param locale the locale to use
*
- * @exception NullPointerException if value is null
+ * @exception NullPointerException if value and/or locale is null
*/
protected TextSyntax(String value, Locale locale)
{
- if (value == null)
- throw new NullPointerException("value may not be null");
+ if (value == null || locale == null)
+ throw new NullPointerException("value and/or locale may not be null");
this.value = value;
this.locale = locale;
*/
public int hashCode()
{
- return value.hashCode() + locale.hashCode();
+ return value.hashCode() ^ locale.hashCode();
}
/**
*
* @param obj the object to test
*
- * @returns true if both objects are equal, false otherwise.
+ * @return true if both objects are equal, false otherwise.
*/
public boolean equals(Object obj)
{
return (value.equals(tmp.getValue())
&& locale.equals(tmp.getLocale()));
}
+
+ /**
+ * Returns a string representing the object.
+ */
+ public String toString()
+ {
+ return value;
+ }
}