JavaTM Platform
Standard Ed. 6

javax.print.attribute.standard
类 DocumentName

java.lang.Object
  继承者 javax.print.attribute.TextSyntax
      继承者 javax.print.attribute.standard.DocumentName
所有已实现的接口:
Serializable, Cloneable, Attribute, DocAttribute

public final class DocumentName
     
extends TextSyntax
implements DocAttribute

DocumentName 类是打印属性类,它是一个文本属性,指定了文档名称。DocumentName 是打印数据(文档)的属性,而不是 Print Job 的属性。文档名称是客户机所定义的任意字符串。但是,如果未指定 JobName,则应使用 DocumentName 替代,这意味着 DocumentName 支持规范要求 JobName 的报告,反之亦然。有关更多信息,请参阅 JobName

IPP Compatibility: 字符串值给出了 IPP 名称值。语言环境给出了 IPP 自然语言。getName() 所返回的类别名称给出了 IPP 属性名称。

另请参见:
序列化表格

构造方法摘要
DocumentName(String documentName, Locale locale)
          构造具有给定文档名称和语言环境的新文档名称属性。
 
方法摘要
 boolean equals(Object object)
          返回此文档名称属性是否等效于传入的对象。
 Class<? extends Attribute> getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 String getName()
          获取类别名称,这里此属性值是该类别的实例。
 
从类 javax.print.attribute.TextSyntax 继承的方法
getLocale, getValue, hashCode, toString
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

DocumentName

public DocumentName(String documentName,
                    Locale locale)
构造具有给定文档名称和语言环境的新文档名称属性。

参数:
documentName - 文档名称。
locale - 文本字符串的自然语言。null 被解释为意味着 Locale.getDefault() 所返回的默认语言环境
抛出:
NullPointerException - (未经检查的异常)如果 documentName 为 null,则抛出该异常。
方法详细信息

equals

public boolean equals(Object object)
返回此文档名称属性是否等效于传入的对象。若要等效,以下所有条件都必须为 true:
  1. object 不为 null。
  2. object 为 DocumentName 类的实例。
  3. 此文档名称属性的底层字符串与 object 的底层字符串相同。
  4. 此文档名称属性的语言环境与 object 的语言环境相同。

覆盖:
TextSyntax 中的 equals
参数:
object - 要比较的 Object。
返回:
如果 object 等效于此文档名称属性,则返回 true,否则返回 false。
另请参见:
Object.hashCode(), Hashtable

getCategory

public final Class<? extends Attribute> getCategory()
获取将被用作此打印属性值的“类别”的打印属性类。

对于 DocumentName 类,类别为 DocumentName 类本身。

指定者:
接口 Attribute 中的 getCategory
返回:
打印属性类(类别),它是 java.lang.Class 类的实例。

getName

public final String getName()
获取类别名称,这里此属性值是该类别的实例。

对于 DocumentName 类,类别名称为 "document-name"

指定者:
接口 Attribute 中的 getName
返回:
属性类别名称。

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策