barcode4j 2.1.0

org.krysalis.barcode4j.impl.fourstate
Class RoyalMailCBCLogicImpl

java.lang.Object
  extended by org.krysalis.barcode4j.impl.fourstate.AbstractFourStateLogicImpl
      extended by org.krysalis.barcode4j.impl.fourstate.AbstractRMCBCKIXLogicImpl
          extended by org.krysalis.barcode4j.impl.fourstate.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 Summary
RoyalMailCBCLogicImpl(ChecksumMode mode)
          Main constructor
 
Method Summary
 char calcChecksum(java.lang.String msg)
          Calculates the checksum for a message to be encoded as an one of the foru-state barcode symbologies.
protected  java.lang.String handleChecksum(java.lang.String msg)
          Handles the checksum, either checking if the right value was specified or adding the missing checksum depending on the settings.
 java.lang.String normalizeMessage(java.lang.String msg)
          Turns the given message into a normalize representation.
static java.lang.String removeStartStop(java.lang.String msg)
          Removes the start and stop characters from the message.
 
Methods inherited from class org.krysalis.barcode4j.impl.fourstate.AbstractRMCBCKIXLogicImpl
encodeHighLevel
 
Methods inherited from class org.krysalis.barcode4j.impl.fourstate.AbstractFourStateLogicImpl
encodeCodeword, generateBarcodeLogic, getChecksumMode, isIgnoredChar, validateChecksum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoyalMailCBCLogicImpl

public RoyalMailCBCLogicImpl(ChecksumMode mode)
Main constructor

Parameters:
mode - checksum mode
Method Detail

calcChecksum

public char calcChecksum(java.lang.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

handleChecksum

protected java.lang.String handleChecksum(java.lang.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

removeStartStop

public static java.lang.String removeStartStop(java.lang.String msg)
Removes the start and stop characters from the message.

Parameters:
msg - the message
Returns:
the modified message

normalizeMessage

public java.lang.String normalizeMessage(java.lang.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

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.