APIdia Launch Partner
Top Description Fields Constructors Methods
javax.print.attribute.standard

public abstract Class Media

extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
Class Inheritance
All Implemented Interfaces
javax.print.attribute.PrintJobAttribute, javax.print.attribute.Attribute, java.io.Serializable, javax.print.attribute.PrintRequestAttribute, javax.print.attribute.DocAttribute
Known Direct Subclasses
javax.print.attribute.standard.MediaName, javax.print.attribute.standard.MediaSizeName, javax.print.attribute.standard.MediaTray
Imports
java.io.Serial, javax.print.attribute.Attribute, .DocAttribute, .EnumSyntax, .PrintJobAttribute, .PrintRequestAttribute

Class Media is a printing attribute class that specifies the medium on which to print.

Media may be specified in different ways.

Each of these corresponds to the IPP "media" attribute. The current API does not support describing media by characteristics (eg colour, opacity). This may be supported in a later revision of the specification.

A Media object is constructed with a value which represents one of the ways in which the Media attribute can be specified.

IPP Compatibility: The category name returned by getName() is the IPP attribute name. The enumeration's integer value is the IPP enum value. The toString() method returns the IPP string representation of the attribute value.

Author
Phil Race

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Hides javax.print.attribute.EnumSyntax.serialVersionUID.

Use serialVersionUID from JDK 1.4 for interoperability.

Constructor Summary

AccessConstructor and Description
protected
Media(int
a value
value
)

Constructs a new media attribute specified by name.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if object is equivalent to this media attribute, false otherwise
equals
(Object
Object to compare to
object
)

Overrides java.lang.Object.equals.

Returns whether this media attribute is equivalent to the passed in object.

public final Class<? extends Attribute>

Returns:

printing attribute class (category), an instance of class java.lang.Class
getCategory
()

Implements javax.print.attribute.Attribute.getCategory.

Get the printing attribute class which is to be used as the "category" for this printing attribute value.

public final String

Returns:

attribute category name
getName
()

Implements javax.print.attribute.Attribute.getName.

Get the name of the category of which this attribute value is an instance.

Inherited from javax.print.attribute.EnumSyntax:
clonegetEnumValueTablegetOffsetgetStringTablegetValuehashCodereadResolvetoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.print.attribute.EnumSyntax.serialVersionUID.

Use serialVersionUID from JDK 1.4 for interoperability.

Annotations
@Serial

Constructor Detail

Mediaback to summary
protected Media(int value)

Constructs a new media attribute specified by name.

Parameters
value:int

a value

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Returns whether this media attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:

  1. object is not null.
  2. object is of the same subclass of Media as this object.
  3. The values are equal.
Parameters
object:Object

Object to compare to

Returns:boolean

true if object is equivalent to this media attribute, false otherwise

Annotations
@Override
getCategoryback to summary
public final Class<? extends Attribute> getCategory()

Implements javax.print.attribute.Attribute.getCategory.

Get the printing attribute class which is to be used as the "category" for this printing attribute value.

For class Media and any vendor-defined subclasses, the category is class Media itself.

Returns:Class<? extends Attribute>

printing attribute class (category), an instance of class java.lang.Class

Annotations
@Override
getNameback to summary
public final String getName()

Implements javax.print.attribute.Attribute.getName.

Get the name of the category of which this attribute value is an instance.

For class Media and any vendor-defined subclasses, the category name is "media".

Returns:String

attribute category name

Annotations
@Override