PrintJob
class PrintJob
| kotlin.Any | |
| ↳ | android.print.PrintJob | 
This class represents a print job from the perspective of an application. It contains behavior methods for performing operations on it as well as methods for querying its state. A snapshot of the print job state is represented by the PrintJobInfo class. The state of a print job may change over time. An application receives instances of this class when creating a print job or querying for its print jobs.
Summary
| Public methods | |
|---|---|
| Unit | cancel()Cancels this print job. | 
| Boolean | Indicates whether some other object is "equal to" this one. | 
| PrintJobId? | getId()Gets the unique print job id. | 
| PrintJobInfo | getInfo()Gets the  | 
| Int | hashCode() | 
| Boolean | Gets whether this print job is blocked. | 
| Boolean | Gets whether this print job is cancelled. | 
| Boolean | Gets whether this print job is completed. | 
| Boolean | isFailed()Gets whether this print job is failed. | 
| Boolean | isQueued()Gets whether this print job is queued. | 
| Boolean | Gets whether this print job is started. | 
| Unit | restart()Restarts this print job. | 
Public methods
cancel
fun cancel(): Unit
Cancels this print job. You can request cancellation of a queued, started, blocked, or failed print job.
See Also
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
 The equals method implements an equivalence relation on non-null object references: 
- It is reflexive: for any non-null reference value x,x.equals(x)should returntrue.
- It is symmetric: for any non-null reference values xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue.
- It is transitive: for any non-null reference values x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue.
- It is consistent: for any non-null reference values xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified.
- For any non-null reference value x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
| obj | This value may be null. | 
| Return | |
|---|---|
| Boolean | trueif this object is the same as the obj argument;falseotherwise. | 
getId
fun getId(): PrintJobId?
Gets the unique print job id.
| Return | |
|---|---|
| PrintJobId? | The id. This value may be null. | 
getInfo
fun getInfo(): PrintJobInfo
Gets the PrintJobInfo that describes this job. 
Node:The returned info object is a snapshot of the current print job state. Every call to this method returns a fresh info object that reflects the current print job state.
| Return | |
|---|---|
| PrintJobInfo | The print job info. This value cannot be null. | 
isBlocked
fun isBlocked(): Boolean
Gets whether this print job is blocked. Such a print job is halted due to an abnormal condition. You can request a cancellation via cancel().
| Return | |
|---|---|
| Boolean | Whether the print job is blocked. | 
See Also
isCancelled
fun isCancelled(): Boolean
Gets whether this print job is cancelled. Such a print job was cancelled as a result of a user request. This is a final state. You cannot restart such a print job.
| Return | |
|---|---|
| Boolean | Whether the print job is cancelled. | 
isCompleted
fun isCompleted(): Boolean
Gets whether this print job is completed. Such a print job is successfully printed. You can neither cancel nor restart such a print job.
| Return | |
|---|---|
| Boolean | Whether the print job is completed. | 
isFailed
fun isFailed(): Boolean
Gets whether this print job is failed. Such a print job is not successfully printed due to an error. You can request a restart via restart() or cancel via cancel().
| Return | |
|---|---|
| Boolean | Whether the print job is failed. | 
See Also
isQueued
fun isQueued(): Boolean
Gets whether this print job is queued. Such a print job is ready to be printed. You can request a cancellation via cancel().
| Return | |
|---|---|
| Boolean | Whether the print job is queued. | 
See Also
isStarted
fun isStarted(): Boolean
Gets whether this print job is started. Such a print job is being printed. You can request a cancellation via cancel().
| Return | |
|---|---|
| Boolean | Whether the print job is started. | 
See Also
restart
fun restart(): Unit
Restarts this print job. You can request restart of a failed print job.
See Also
