public class POSTNETLogicImpl extends Object
| Constructor and Description |
|---|
POSTNETLogicImpl(ChecksumMode mode,
boolean displayChecksum)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
static char |
calcChecksum(String msg)
Calculates the checksum for a message to be encoded as an
POSTNET barcode.
|
protected void |
encodeChar(ClassicBarcodeLogicHandler logic,
char c)
Encodes a single character.
|
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)).
|
static String |
removeIgnoredCharacters(String msg)
Removes ignored character from a valid POSTNET message.
|
static boolean |
validateChecksum(String msg)
Verifies the checksum for a message.
|
public POSTNETLogicImpl(ChecksumMode mode, boolean displayChecksum)
mode - checksum modedisplayChecksum - Controls whether to display checksum
in the human-readable messagepublic ChecksumMode getChecksumMode()
public static char calcChecksum(String msg)
msg - message to calculate the check digit forpublic static boolean validateChecksum(String msg)
msg - message (check digit included)public static boolean isIgnoredChar(char c)
c - character to checkpublic static String removeIgnoredCharacters(String msg)
msg - valid POSTNET messageprotected void encodeChar(ClassicBarcodeLogicHandler logic, char c)
logic - the logic handler to receive generated eventsc - the character to encodepublic void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg)
logic - the logic handler to receive generated eventsmsg - the message to encodeCopyright © 2003–2023. All rights reserved.