javax.print.attribute
Class IntegerSyntax

java.lang.Object
  extended by javax.print.attribute.IntegerSyntax
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
Copies, JobImpressions, JobImpressionsCompleted, JobKOctets, JobKOctetsProcessed, JobMediaSheets, JobMediaSheetsCompleted, JobPriority, JobPrioritySupported, NumberOfDocuments, NumberOfInterveningJobs, NumberUp, PagesPerMinute, PagesPerMinuteColor, QueuedJobCount

public abstract class IntegerSyntax
extends Object
implements Cloneable, Serializable

IntegerSyntax is the abstract base class of all attribute classes having an integer as value.

See Also:
Serialized Form

Constructor Summary
protected IntegerSyntax(int value)
          Creates a IntegerSyntax with the given value.
protected IntegerSyntax(int value, int lowerBound, int upperBound)
          Creates a IntegerSyntax with the given integer value and checks if the value lies inside the given bounds..
 
Method Summary
 boolean equals(Object obj)
          Tests if the given object is equal to this object.
 int getValue()
          Returns the value of this object.
 int hashCode()
          Returns the hashcode for this object.
 String toString()
          Returns the string representation for this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerSyntax

protected IntegerSyntax(int value)
Creates a IntegerSyntax with the given value.

Parameters:
value - the integer to set

IntegerSyntax

protected IntegerSyntax(int value,
                        int lowerBound,
                        int upperBound)
Creates a IntegerSyntax with the given integer value and checks if the value lies inside the given bounds..

Parameters:
value - the integer to set
lowerBound - the lower bound for the value
upperBound - the upper bound for the value
Throws:
IllegalArgumentException - if value < lowerBound or value > upperBound
Method Detail

getValue

public int getValue()
Returns the value of this object.

Returns:
The integer value.

equals

public boolean equals(Object obj)
Tests if the given object is equal to this object.

Overrides:
equals in class Object
Parameters:
obj - the object to test
Returns:
true if both objects are equal, false otherwise.
See Also:
Object.hashCode()

hashCode

public int hashCode()
Returns the hashcode for this object.

Overrides:
hashCode in class Object
Returns:
The hashcode.
See Also:
Object.equals(Object), System.identityHashCode(Object)

toString

public String toString()
Returns the string representation for this object.

Overrides:
toString in class Object
Returns:
The string representation.
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)