JavaTM Platform
Standard Ed. 6

接口 javax.print.attribute.Attribute
的使用

使用 Attribute 的软件包
javax.print 为 JavaTM Print Service API 提供了主要类和接口。 
javax.print.attribute 提供了描述 JavaTM Print Service 属性的类型以及如何分类这些属性的类和接口。 
javax.print.attribute.standard 包 javax.print.attribute.standard 包括特定打印属性的类。 
 

javax.print 中 Attribute 的使用
 

返回 Attribute 的 javax.print 中的方法
 Attribute[] AttributeException.getUnsupportedValues()
          返回其 PrintService 实例支持该属性,但是不支持该属性特定值的打印属性数组,如果没有这种属性值,则返回 null。
 

参数类型为 Attribute 的 javax.print 中的方法
 boolean PrintService.isAttributeValueSupported(Attribute attrval, DocFlavor flavor, AttributeSet attributes)
          确定客户端在设置此 PrintService 的作业时,是否可以指定给定的打印属性值。
 

类型变量类型为 Attribute 的 javax.print 中的方法参数
 Object PrintService.getDefaultAttributeValue(Class<? extends Attribute> category)
          确定给定类别中此 PrintService 的默认打印属性值。
 Object PrintService.getSupportedAttributeValues(Class<? extends Attribute> category, DocFlavor flavor, AttributeSet attributes)
          确定客户端在设置此 PrintService 的作业时,是否可以指定给定类别中的打印属性值。
 boolean PrintService.isAttributeCategorySupported(Class<? extends Attribute> category)
          确定客户端在设置此 PrintService 的作业时,是否可以指定给定打印属性类别。
 

javax.print.attribute 中 Attribute 的使用
 

javax.print.attribute 中 Attribute 的子接口
 interface DocAttribute
          接口 DocAttribute 是打印属性类实现的一个标记接口,用于指示属性表示文档 (doc) 的设置(“Doc”是一个简短的、容易发音的术语,指“打印数据的片段”。
 interface PrintJobAttribute
          PrintJobAttribute 是打印属性类实现的标记接口,以指示该属性描述“打印作业”的状态或“打印作业”的一些其他特征。
 interface PrintRequestAttribute
          接口 PrintRequestAttribute 是打印属性类实现的标记接口,以指示属性表示用于打印作业的请求设置。
 interface PrintServiceAttribute
          接口 PrintServiceAttribute 是打印属性类实现的标记接口,以指示该属性描述“打印服务”的状态或“打印服务”的一些其他特征。
 interface SupportedValuesAttribute
          接口 SupportedValuesAttribute 是打印属性类实现的标记接口,以指示该属性描述用于其他属性的支持值。
 

返回 Attribute 的 javax.print.attribute 中的方法
 Attribute AttributeSet.get(Class<?> category)
          返回此属性集在给定的属性类别中包含的属性值。
 Attribute HashAttributeSet.get(Class<?> category)
          返回此属性集在给定的属性类别中包含的属性值。
 Attribute[] AttributeSet.toArray()
          返回此集合中包含的属性的数组。
 Attribute[] HashAttributeSet.toArray()
           
static Attribute AttributeSetUtilities.verifyAttributeValue(Object object, Class<?> interfaceName)
          验证给定的对象是否为给定接口(假定为接口 Attribute 或其子接口)的一个实例。
 

返回变量类型为 Attribute 的类型的 javax.print.attribute 中的方法
 Class<? extends Attribute> Attribute.getCategory()
          将此打印属性值添加到属性集时,为它获取用作“类别”的打印属性类。
 

参数类型为 Attribute 的 javax.print.attribute 中的方法
 boolean AttributeSet.add(Attribute attribute)
          如果指定的属性尚不存在,则将它添加到此属性集中,首先要移除与指定属性值相同的属性类别中的任何现有值。
 boolean DocAttributeSet.add(Attribute attribute)
          如果指定的属性值不存在,则将其添加到此属性集中,方法是首先移除与指定属性值相同的属性类别中的任何现有值(可选操作)。
 boolean HashAttributeSet.add(Attribute attribute)
          如果指定的属性不存在,则将它添加到此属性集中,方法是首先移除与指定属性值相同的属性类别中的任何现有属性。
 boolean PrintJobAttributeSet.add(Attribute attribute)
          如果指定的属性值不存在,则将其添加到此属性集中,方法是首先移除与指定属性值相同的属性类别中的任何现有值(可选操作)。
 boolean PrintRequestAttributeSet.add(Attribute attribute)
          如果指定的属性值不存在,则将其添加到此属性集中,方法是首先移除与指定属性值相同的属性类别中的任何现有值(可选操作)。
 boolean PrintServiceAttributeSet.add(Attribute attribute)
          如果指定的属性值不存在,则将其添加到此属性集中,方法是首先移除与指定属性值相同的属性类别中的任何现有值(可选操作)。
 boolean AttributeSet.containsValue(Attribute attribute)
          如果此属性集包含给定的属性值,则返回 true。
 boolean HashAttributeSet.containsValue(Attribute attribute)
          如果此属性集包含给定的属性,则返回 true。
 boolean AttributeSet.remove(Attribute attribute)
          从此属性集移除指定的属性(如果存在)。
 boolean HashAttributeSet.remove(Attribute attribute)
          从此属性集移除指定的属性(如果存在)。
static void AttributeSetUtilities.verifyCategoryForValue(Class<?> category, Attribute attribute)
          验证给定的属性类别对象是否等于给定属性值对象的类别。
 

参数类型为 Attribute 的 javax.print.attribute 中的构造方法
HashAttributeSet(Attribute attribute)
          构造一个最初使用给定属性填充的新属性集。
HashAttributeSet(Attribute[] attributes)
          构造一个最初使用给定数组中的值填充的新属性集。
HashAttributeSet(Attribute[] attributes, Class<?> interfaceName)
          构造一个新的属性集,其中该属性集的成员限于给定的接口。
HashAttributeSet(Attribute attribute, Class<?> interfaceName)
          构造一个最初使用给定属性填充的新属性集,其中该属性集的成员限于给定的接口。
 

javax.print.attribute.standard 中 Attribute 的使用
 

返回变量类型为 Attribute 的类型的 javax.print.attribute.standard 中的方法
 Class<? extends Attribute> Chromaticity.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> ColorSupported.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Compression.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Copies.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> CopiesSupported.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> DateTimeAtCompleted.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> DateTimeAtCreation.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> DateTimeAtProcessing.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Destination.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> DocumentName.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Fidelity.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Finishings.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobHoldUntil.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobImpressions.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobImpressionsCompleted.getCategory()
          获取被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobImpressionsSupported.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobKOctets.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobKOctetsProcessed.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobKOctetsSupported.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobMediaSheets.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobMediaSheetsCompleted.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobMediaSheetsSupported.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobMessageFromOperator.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobName.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobOriginatingUserName.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobPriority.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobPrioritySupported.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobSheets.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobState.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobStateReason.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> JobStateReasons.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Media.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> MediaPrintableArea.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> MediaSize.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> MultipleDocumentHandling.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> NumberOfDocuments.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> NumberOfInterveningJobs.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> NumberUp.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> NumberUpSupported.getCategory()
          获取将被用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> OrientationRequested.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> OutputDeviceAssigned.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PDLOverrideSupported.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PageRanges.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PagesPerMinute.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PagesPerMinuteColor.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PresentationDirection.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrintQuality.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterInfo.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterIsAcceptingJobs.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterLocation.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterMakeAndModel.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterMessageFromOperator.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterMoreInfo.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterMoreInfoManufacturer.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterName.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterResolution.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterState.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterStateReason.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterStateReasons.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> PrinterURI.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> QueuedJobCount.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> ReferenceUriSchemesSupported.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> RequestingUserName.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Severity.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> SheetCollate.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 Class<? extends Attribute> Sides.getCategory()
          获取将用作此打印属性值的“类别”的打印属性类。
 


JavaTM Platform
Standard Ed. 6

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

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