Record Class PrintJob

java.lang.Object
java.lang.Record
limn.backend.spi.PrintJob
Record Components:
title - the job's name, shown in the system's queue and as the dialog's title where a dialog has one; never blank
pdf - the document, a complete PDF file
paperWidth - the width of the paper the document was laid out on, in points (1/72 inch), or 0 when it is not known (a PDF the application received)
paperHeight - its height in points, or 0 when it is not known
pageCount - how many pages the document has, or -1 when it is not known

public record PrintJob(String title, byte[] pdf, float paperWidth, float paperHeight, int pageCount) extends Record
What a PrinterPeer hands the system: a PDF, the job's name, and the paper the document was laid out on, which the system's dialog starts from.

The bytes are the caller's and are not copied: a peer reads them and does not change them.

  • Constructor Summary

    Constructors
    Constructor
    Description
    PrintJob(String title, byte[] pdf, float paperWidth, float paperHeight, int pageCount)
    Creates an instance of a PrintJob record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
     
    int
    Returns the value of the pageCount record component.
    float
    Returns the value of the paperHeight record component.
    float
    Returns the value of the paperWidth record component.
    byte[]
    pdf()
    Returns the value of the pdf record component.
    Returns the value of the title record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PrintJob

      public PrintJob(String title, byte[] pdf, float paperWidth, float paperHeight, int pageCount)
      Creates an instance of a PrintJob record class.
      Parameters:
      title - the value for the title record component
      pdf - the value for the pdf record component
      paperWidth - the value for the paperWidth record component
      paperHeight - the value for the paperHeight record component
      pageCount - the value for the pageCount record component
  • Method Details

    • knowsPaper

      public boolean knowsPaper()
      Returns:
      whether the paper is known, as it is for a document Limn laid out
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • pdf

      public byte[] pdf()
      Returns the value of the pdf record component.
      Returns:
      the value of the pdf record component
    • paperWidth

      public float paperWidth()
      Returns the value of the paperWidth record component.
      Returns:
      the value of the paperWidth record component
    • paperHeight

      public float paperHeight()
      Returns the value of the paperHeight record component.
      Returns:
      the value of the paperHeight record component
    • pageCount

      public int pageCount()
      Returns the value of the pageCount record component.
      Returns:
      the value of the pageCount record component