Class CodabarLogicImpl

java.lang.Object
org.krysalis.barcode4j.impl.codabar.CodabarLogicImpl

public class CodabarLogicImpl extends Object
This class is an implementation of the Codabar barcode.
Version:
$Id: CodabarLogicImpl.java,v 1.4 2008-11-22 09:57:10 jmaerki Exp $
Author:
Jeremias Maerki
  • Constructor Details

    • CodabarLogicImpl

      public CodabarLogicImpl(ChecksumMode mode)
      Main constructor
      Parameters:
      mode - Determines how checksums are to be treated.
    • CodabarLogicImpl

      public CodabarLogicImpl(ChecksumMode mode, boolean displayStartStop)
      Main constructor
      Parameters:
      mode - Determines how checksums are to be treated.
      displayStartStop - enables or disables suppressing the start/stop characters from the human-readable part
  • Method Details

    • getCharIndex

      protected static int getCharIndex(char ch)
      Returns the index of a character within the character set.
      Parameters:
      ch - the character to lookup
      Returns:
      the index of the character or -1 if it isn't supported
    • isValidChar

      protected static boolean isValidChar(char ch)
      Determines whether a character is a valid message character.
      Parameters:
      ch - the character to check
      Returns:
      true if it is a valid character, false otherwise
    • isStartStopChar

      protected static boolean isStartStopChar(char ch)
      Determines whether a character is on of the start/stop characters.
      Parameters:
      ch - the character to check
      Returns:
      true if it is a start/stop character
    • getChecksumMode

      public ChecksumMode getChecksumMode()
      Returns the checksum mode.
      Returns:
      the current checksum mode
    • encodeChar

      protected void encodeChar(ClassicBarcodeLogicHandler logic, char ch)
      Encodes a character to a logic handler.
      Parameters:
      logic - the logic handler to send events to
      ch - the character to encode
    • generateBarcodeLogic

      public void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg)
      Generates the barcode logic.
      Parameters:
      logic - the logic handler to send generated events to
      msg - the message to encode