Barcode-Lib4J requires Java 11+

Java Class «PDF417Size»

java.lang.Object
de.vwsoft.barcodelib4j.twod.PDF417Size

public class PDF417Size extends Object
Immutable representation of a PDF417 symbol size.

PDF417 symbols are defined by their column count (1-30) and row count (3-90). The special value 0 can be used for either dimension to indicate automatic sizing based on the data to be encoded.

Examples:

   // Fixed size: 10 columns, 20 rows
   PDF417Size fixed = new PDF417Size(10, 20);

   // Auto columns, fixed 20 rows
   PDF417Size autoCols = new PDF417Size(0, 20);

   // Fully automatic sizing
   PDF417Size auto = new PDF417Size(0, 0);
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The number of columns, or 0 for automatic sizing.
    static final int
    Maximum number of columns (code words) in a valid PDF417 symbol; value: 30.
    static final int
    Minimum number of columns (code words) in a valid PDF417 symbol; value: 1.
    final int
    The number of rows, or 0 for automatic sizing.
    static final int
    Maximum number of rows in a valid PDF417 symbol; value: 90.
    static final int
    Minimum number of rows in a valid PDF417 symbol; value: 3.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PDF417Size(int cols, int rows)
    Creates a new instance with the specified column and row counts.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this size equals the specified object.
    int
    Returns the hash code calculated from the columns and rows values.
    Returns a string representation of this instance.

    Methods inherited from class java.lang.Object

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

    • ROWS_MIN

      public static final int ROWS_MIN
      Minimum number of rows in a valid PDF417 symbol; value: 3.
    • ROWS_MAX

      public static final int ROWS_MAX
      Maximum number of rows in a valid PDF417 symbol; value: 90.
    • COLS_MIN

      public static final int COLS_MIN
      Minimum number of columns (code words) in a valid PDF417 symbol; value: 1.
    • COLS_MAX

      public static final int COLS_MAX
      Maximum number of columns (code words) in a valid PDF417 symbol; value: 30.
    • cols

      public final int cols
      The number of columns, or 0 for automatic sizing.
    • rows

      public final int rows
      The number of rows, or 0 for automatic sizing.
  • Constructor Details

    • PDF417Size

      public PDF417Size(int cols, int rows)
      Creates a new instance with the specified column and row counts.

      Use 0 for either dimension to enable automatic sizing for that dimension.

      Parameters:
      cols - the number of columns (1-30, or 0 for auto)
      rows - the number of rows (3-90, or 0 for auto)
      Throws:
      IllegalArgumentException - if column count or row count is outside the respective valid range
  • Method Details

    • equals

      public boolean equals(Object obj)
      Returns true if this size equals the specified object.

      Two PDF417Size objects are equal if they have the same column and row counts.

      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with
      Returns:
      true if this size equals the specified object
    • hashCode

      public int hashCode()
      Returns the hash code calculated from the columns and rows values.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code calculated from the columns and rows values
    • toString

      public String toString()
      Returns a string representation of this instance.

      This method is intended to be used only for debugging purposes.

      Overrides:
      toString in class Object
      Returns:
      a string representation of this instance