barcode4j 2.1.0

org.krysalis.barcode4j.impl.codabar
Class CodabarLogicImpl

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

public class CodabarLogicImpl
extends java.lang.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
TODO:
Complete the implementation (checksum, automatic start/stops chars...)

Constructor Summary
CodabarLogicImpl(ChecksumMode mode)
          Main constructor
CodabarLogicImpl(ChecksumMode mode, boolean displayStartStop)
          Main constructor
 
Method Summary
protected  void encodeChar(ClassicBarcodeLogicHandler logic, char ch)
          Encodes a character to a logic handler.
 void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, java.lang.String msg)
          Generates the barcode logic.
protected static int getCharIndex(char ch)
          Returns the index of a character within the character set.
 ChecksumMode getChecksumMode()
          Returns the checksum mode.
protected static boolean isStartStopChar(char ch)
          Determines whether a character is on of the start/stop characters.
protected static boolean isValidChar(char ch)
          Determines whether a character is a valid message character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

getChecksumMode

public ChecksumMode getChecksumMode()
Returns the checksum mode.

Returns:
the current checksum mode

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

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,
                                 java.lang.String msg)
Generates the barcode logic.

Parameters:
logic - the logic handler to send generated events to
msg - the message to encode

barcode4j 2.1.0

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