javax.print.attribute
Class TextSyntax

java.lang.Object
  extended by javax.print.attribute.TextSyntax
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
DocumentName, JobMessageFromOperator, JobName, JobOriginatingUserName, OutputDeviceAssigned, PrinterInfo, PrinterLocation, PrinterMakeAndModel, PrinterMessageFromOperator, PrinterName, RequestingUserName

public abstract class TextSyntax
extends Object
implements Cloneable, Serializable

TextSyntax is the abstract base class of all attribute classes which provide a string as value (e.g. the location of the printer).

A TextSyntax instance consists of a string value and a locale which indicates the language of the locale of the string.

See Also:
Serialized Form

Constructor Summary
protected TextSyntax(String value, Locale locale)
          Creates a TextSyntax object with the given value and locale.
 
Method Summary
 boolean equals(Object obj)
          Tests if the given object is equal to this object.
 Locale getLocale()
          Returns the locale of this syntax object.
 String getValue()
          Returns the value of this syntax object.
 int hashCode()
          Returns the hashcode for this object.
 String toString()
          Returns a string representing the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextSyntax

protected TextSyntax(String value,
                     Locale locale)
Creates a TextSyntax object with the given value and locale.

Parameters:
value - the value for this syntax
locale - the locale to use, if null the default locale is used.
Throws:
NullPointerException - if value is null
Method Detail

getValue

public String getValue()
Returns the value of this syntax object.

Returns:
The value.

getLocale

public Locale getLocale()
Returns the locale of this syntax object.

Returns:
The locale.

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)

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()

toString

public String toString()
Returns a string representing the object. The returned string is the underlying text value of this object.

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