- java.lang.Object
-
- javax.print.attribute.TextSyntax
-
- javax.print.attribute.standard.PrinterInfo
-
- All Implemented Interfaces:
-
Serializable,Cloneable,Attribute,PrintServiceAttribute
public final class PrinterInfo extends TextSyntax implements PrintServiceAttribute
PrinterInfo类是一个打印属性类,一个文本属性,它提供有关打印机的描述信息。 这可能包括以下内容:"This printer can be used for printing color transparencies for HR presentations"或"Out of courtesy for others, please print only small (1-5 page) jobs at this printer",甚至"This printer is going away on July 1, 1997, please find a new printer"。IPP兼容性:字符串值给出IPP名称值。 该地区提供IPP自然语言。 由
getName()返回的类别名称提供IPP属性名称。- 另请参见:
- Serialized Form
-
-
构造方法摘要
构造方法 Constructor 描述 PrinterInfo(String info, Locale locale)使用给定的信息字符串和语言环境构造新的打印机信息属性。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 booleanequals(Object object)返回此打印机信息属性是否等同于传入的对象。Class<? extends Attribute>getCategory()获取要用作此打印属性值的“类别”的打印属性类。StringgetName()获取此属性值是一个实例的类别的名称。-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class javax.print.attribute.TextSyntax
getLocale, getValue, hashCode, toString
-
-
-
-
构造方法详细信息
-
PrinterInfo
public PrinterInfo(String info, Locale locale)
使用给定的信息字符串和语言环境构造新的打印机信息属性。- 参数
-
info- 打印机信息字符串。 -
locale- 文本字符串的自然语言。 null被解释为Locale.getDefault()返回的默认语言环境 - 异常
-
NullPointerException- (未选中的异常)如果info为空,则抛出。
-
-
方法详细信息
-
equals
public boolean equals(Object object)
返回此打印机信息属性是否等同于传入的对象。 要相等的,所有以下条件必须为真:-
object不为空。 -
object是PrinterInfo类的一个实例。 - 此打印机info属性的底层字符串和
object的底层字符串相等。 - 此打印机信息属性的区域设置和
object的区域设置相等。
- 重写:
-
equals在TextSyntax - 参数
-
object- 要比较的对象。 - 结果
-
如果
object等效于此打印机info属性,objecttrue,否则为false。 - 另请参见:
-
Object.hashCode(),HashMap
-
-
getCategory
public final Class<? extends Attribute> getCategory()
获取要用作此打印属性值的“类别”的打印属性类。对于PrinterInfo类,该类别是PrinterInfo类。
- Specified by:
-
getCategory在接口Attribute - 结果
-
打印属性类(category),一个
java.lang.Class类的实例。
-
-