Class USPSIntelligentMailLogicImpl

java.lang.Object
org.krysalis.barcode4j.impl.fourstate.AbstractFourStateLogicImpl
org.krysalis.barcode4j.impl.fourstate.USPSIntelligentMailLogicImpl

public class USPSIntelligentMailLogicImpl extends AbstractFourStateLogicImpl
This class is a logic implementation for the USPS Intelligent Mail Barcode (aka 4-State Customer Barcode, USPS-B-3200 revision E, 2007-10-30).
  • Constructor Details

    • USPSIntelligentMailLogicImpl

      public USPSIntelligentMailLogicImpl()
      Main constructor.
  • Method Details

    • calcChecksum

      public char calcChecksum(String msg)
      Calculates the checksum for a message to be encoded as an one of the foru-state barcode symbologies.
      Specified by:
      calcChecksum in class AbstractFourStateLogicImpl
      Parameters:
      msg - message to calculate the check digit for
      Returns:
      char the check digit
    • normalizeMessage

      protected String normalizeMessage(String msg)
      Turns the given message into a normalize representation. Some subclasses may update/add parentheses around the message and/or handle the checksum as necessary.
      Specified by:
      normalizeMessage in class AbstractFourStateLogicImpl
      Parameters:
      msg - the message
      Returns:
      the normalized message to be encoded
    • encodeHighLevel

      protected String[] encodeHighLevel(String msg)
      Does the high-level encoding of the message into codewords.
      Specified by:
      encodeHighLevel in class AbstractFourStateLogicImpl
      Parameters:
      msg - the message
      Returns:
      an array of Strings with codewords
    • generateBarcodeLogic

      public void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg)
      Generates the barcode logic
      Overrides:
      generateBarcodeLogic in class AbstractFourStateLogicImpl
      Parameters:
      logic - the logic handler to receive generated events
      msg - the message to encode