Class BarcodeRow


  • final class BarcodeRow
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int currentLocation  
      private byte[] row  
    • Constructor Summary

      Constructors 
      Constructor Description
      BarcodeRow​(int width)
      Creates a Barcode row of the width
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addBar​(boolean black, int width)  
      (package private) byte[] getScaledRow​(int scale)
      This function scales the row
      private void set​(int x, boolean black)
      Sets a specific location in the bar
      (package private) void set​(int x, byte value)
      Sets a specific location in the bar
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • row

        private final byte[] row
      • currentLocation

        private int currentLocation
    • Constructor Detail

      • BarcodeRow

        BarcodeRow​(int width)
        Creates a Barcode row of the width
    • Method Detail

      • set

        void set​(int x,
                 byte value)
        Sets a specific location in the bar
        Parameters:
        x - The location in the bar
        value - Black if true, white if false;
      • set

        private void set​(int x,
                         boolean black)
        Sets a specific location in the bar
        Parameters:
        x - The location in the bar
        black - Black if true, white if false;
      • addBar

        void addBar​(boolean black,
                    int width)
        Parameters:
        black - A boolean which is true if the bar black false if it is white
        width - How many spots wide the bar is.
      • getScaledRow

        byte[] getScaledRow​(int scale)
        This function scales the row
        Parameters:
        scale - How much you want the image to be scaled, must be greater than or equal to 1.
        Returns:
        the scaled row