public class Code128LogicImpl extends Object
| Modifier and Type | Field and Description |
|---|---|
static char |
FNC_1
The function 1 command.
|
static char |
FNC_2
The function 2 command.
|
static char |
FNC_3
The function 3 command.
|
static char |
FNC_4
The function 4 command.
|
| Constructor and Description |
|---|
Code128LogicImpl()
Default constructor.
|
Code128LogicImpl(int codeset)
Main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canBeInCodeSetC(char ch,
boolean second)
Determines whether a character is a digit or a function 1 command.
|
protected void |
encodeChar(ClassicBarcodeLogicHandler logic,
int index)
Encodes a character.
|
protected void |
encodeStop(ClassicBarcodeLogicHandler logic)
Encodes the special stop character.
|
void |
generateBarcodeLogic(ClassicBarcodeLogicHandler logic,
String msg)
Generates the barcode logic
|
protected Code128Encoder |
getEncoder()
Returns the encoder to be used.
|
static boolean |
isInCodeSetA(char ch)
Determines whether a character is defined in codeset A.
|
static boolean |
isInCodeSetB(char ch)
Determines whether a character is defined in codeset B.
|
static boolean |
isValidChar(char ch)
Determines whether a character can be encoded in Code 128.
|
static String |
symbolCharToString(int index)
Converts a character set index to a String representation.
|
static String |
toString(int[] encodedMsg)
Converts an encoded Code 128 message into a String for debugging
purposes.
|
public static final char FNC_1
public static final char FNC_2
public static final char FNC_3
public static final char FNC_4
public Code128LogicImpl()
public Code128LogicImpl(int codeset)
codeset - the enabled codesetpublic static boolean isValidChar(char ch)
ch - the character to checkpublic static boolean isInCodeSetA(char ch)
ch - the character to checkpublic static boolean isInCodeSetB(char ch)
ch - the character to checkpublic static boolean canBeInCodeSetC(char ch,
boolean second)
ch - the character to checksecond - true if checking the character for the second position in
a duo.public static String symbolCharToString(int index)
index - the character set indexpublic static String toString(int[] encodedMsg)
encodedMsg - the encoded messageprotected void encodeChar(ClassicBarcodeLogicHandler logic, int index)
logic - LogicHandler to send the barcode events toindex - index withing the character set of the character to encodeprotected void encodeStop(ClassicBarcodeLogicHandler logic)
logic - LogicHandler to send the barcode events toprotected Code128Encoder getEncoder()
Override this method to supply your own implementation.
public void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg)
logic - the logic handler to receive the generated eventsmsg - the message to encodeCopyright © 2003–2023. All rights reserved.