javax.print.attribute

Class TextSyntax

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.

Constructor Summary
protected TextSyntax(String value, Locale locale)
Creates a TextSyntax object with the given value and locale.
Method Summary
booleanequals(Object obj)
Tests if the given object is equal to this object.
LocalegetLocale()
Returns the locale of this syntax object.
StringgetValue()
Returns the value of this syntax object.
inthashCode()
Returns the hashcode for this object.
StringtoString()
Returns a string representing the object.

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

equals

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

Parameters: obj the object to test

Returns: true if both objects are equal, false otherwise.

getLocale

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

Returns: The locale.

getValue

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

Returns: The value.

hashCode

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

Returns: The hashcode.

toString

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

Returns: The string representation.