public abstract class AbstractFourStateLogicImpl extends Object
| Constructor and Description |
|---|
AbstractFourStateLogicImpl(ChecksumMode mode)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
abstract char |
calcChecksum(String msg)
Calculates the checksum for a message to be encoded as an
one of the foru-state barcode symbologies.
|
protected void |
encodeCodeword(ClassicBarcodeLogicHandler logic,
char c,
String codeword)
Encodes a single character.
|
protected abstract String[] |
encodeHighLevel(String msg)
Does the high-level encoding of the message into codewords.
|
void |
generateBarcodeLogic(ClassicBarcodeLogicHandler logic,
String msg)
Generates the barcode logic
|
ChecksumMode |
getChecksumMode()
Returns the currently active checksum mode.
|
static boolean |
isIgnoredChar(char c)
Checks if a character is an ignored character (such as a '-' (dash)).
|
protected abstract String |
normalizeMessage(String msg)
Turns the given message into a normalize representation.
|
boolean |
validateChecksum(String msg)
Verifies the checksum for a message.
|
public AbstractFourStateLogicImpl(ChecksumMode mode)
mode - checksum modepublic ChecksumMode getChecksumMode()
public abstract char calcChecksum(String msg)
msg - message to calculate the check digit forpublic boolean validateChecksum(String msg)
msg - message (check digit included)public static boolean isIgnoredChar(char c)
c - character to checkprotected abstract String normalizeMessage(String msg)
msg - the messageprotected abstract String[] encodeHighLevel(String msg)
msg - the messageprotected void encodeCodeword(ClassicBarcodeLogicHandler logic, char c, String codeword)
logic - the logic handler to receive generated eventsc - the character to encodecodeword - the codeword belonging to the characterpublic void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg)
logic - the logic handler to receive generated eventsmsg - the message to encodeCopyright © 2003–2023. All rights reserved.