Class CodabarLogicImpl
java.lang.Object
org.krysalis.barcode4j.impl.codabar.CodabarLogicImpl
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 Summary
ConstructorsConstructorDescriptionCodabarLogicImpl(ChecksumMode mode) Main constructorCodabarLogicImpl(ChecksumMode mode, boolean displayStartStop) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidencodeChar(ClassicBarcodeLogicHandler logic, char ch) Encodes a character to a logic handler.voidgenerateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg) Generates the barcode logic.protected static intgetCharIndex(char ch) Returns the index of a character within the character set.Returns the checksum mode.protected static booleanisStartStopChar(char ch) Determines whether a character is on of the start/stop characters.protected static booleanisValidChar(char ch) Determines whether a character is a valid message character.
-
Constructor Details
-
CodabarLogicImpl
Main constructor- Parameters:
mode- Determines how checksums are to be treated.
-
CodabarLogicImpl
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
Returns the checksum mode.- Returns:
- the current checksum mode
-
encodeChar
Encodes a character to a logic handler.- Parameters:
logic- the logic handler to send events toch- the character to encode
-
generateBarcodeLogic
Generates the barcode logic.- Parameters:
logic- the logic handler to send generated events tomsg- the message to encode
-