Class RoyalMailCBCLogicImpl


public class RoyalMailCBCLogicImpl extends AbstractRMCBCKIXLogicImpl
Implements the Royal Mail Customer Barcode (CBC).
Version:
$Id: RoyalMailCBCLogicImpl.java,v 1.2 2008-05-13 13:00:43 jmaerki Exp $
  • Constructor Details

    • RoyalMailCBCLogicImpl

      public RoyalMailCBCLogicImpl(ChecksumMode mode)
      Main constructor
      Parameters:
      mode - checksum mode
  • Method Details

    • removeStartStop

      public static String removeStartStop(String msg)
      Removes the start and stop characters from the message.
      Parameters:
      msg - the message
      Returns:
      the modified message
    • 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

      public 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
    • handleChecksum

      protected String handleChecksum(String msg)
      Handles the checksum, either checking if the right value was specified or adding the missing checksum depending on the settings.
      Parameters:
      msg - the message
      Returns:
      the (possibly) modified message