public final class MinimalEncoder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
MinimalEncoder.Edge |
private static class |
MinimalEncoder.Input |
(package private) static class |
MinimalEncoder.Mode |
private static class |
MinimalEncoder.Result |
Modifier and Type | Field and Description |
---|---|
(package private) static char[] |
C40_SHIFT2_CHARS |
Modifier | Constructor and Description |
---|---|
private |
MinimalEncoder() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addEdge(MinimalEncoder.Edge[][] edges,
MinimalEncoder.Edge edge) |
(package private) static void |
addEdges(MinimalEncoder.Input input,
MinimalEncoder.Edge[][] edges,
int from,
MinimalEncoder.Edge previous) |
(package private) static byte[] |
encode(java.lang.String input,
java.nio.charset.Charset priorityCharset,
int fnc1,
SymbolShapeHint shape,
int macroId)
Encodes input minimally and returns an array of the codewords
|
static java.lang.String |
encodeHighLevel(java.lang.String msg)
Performs message encoding of a DataMatrix message
|
static java.lang.String |
encodeHighLevel(java.lang.String msg,
java.nio.charset.Charset priorityCharset,
int fnc1,
SymbolShapeHint shape)
Performs message encoding of a DataMatrix message
|
(package private) static MinimalEncoder.Result |
encodeMinimally(MinimalEncoder.Input input) |
(package private) static int |
getNumberOfC40Words(MinimalEncoder.Input input,
int from,
boolean c40,
int[] characterLength) |
(package private) static boolean |
isExtendedASCII(char ch,
int fnc1) |
private static boolean |
isInC40Shift1Set(char ch) |
private static boolean |
isInC40Shift2Set(char ch,
int fnc1) |
private static boolean |
isInTextShift1Set(char ch) |
private static boolean |
isInTextShift2Set(char ch,
int fnc1) |
static boolean isExtendedASCII(char ch, int fnc1)
private static boolean isInC40Shift1Set(char ch)
private static boolean isInC40Shift2Set(char ch, int fnc1)
private static boolean isInTextShift1Set(char ch)
private static boolean isInTextShift2Set(char ch, int fnc1)
public static java.lang.String encodeHighLevel(java.lang.String msg)
msg
- the messagepublic static java.lang.String encodeHighLevel(java.lang.String msg, java.nio.charset.Charset priorityCharset, int fnc1, SymbolShapeHint shape)
msg
- the messagepriorityCharset
- The preferred Charset
. When the value of the argument is null, the algorithm
chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority
charset to encode any character in the input that can be encoded by it if the charset is among the
supported charsets.fnc1
- denotes the character in the input that represents the FNC1 character or -1 if this is not a GS1
bar code. If the value is not -1 then a FNC1 is also prepended.shape
- requested shape.static byte[] encode(java.lang.String input, java.nio.charset.Charset priorityCharset, int fnc1, SymbolShapeHint shape, int macroId)
input
- The string to encodepriorityCharset
- The preferred Charset
. When the value of the argument is null, the algorithm
chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority
charset to encode any character in the input that can be encoded by it if the charset is among the
supported charsets.fnc1
- denotes the character in the input that represents the FNC1 character or -1 if this is not a GS1
bar code. If the value is not -1 then a FNC1 is also prepended.shape
- requested shape.macroId
- Prepends the specified macro function in case that a value of 5 or 6 is specified.static void addEdge(MinimalEncoder.Edge[][] edges, MinimalEncoder.Edge edge)
static int getNumberOfC40Words(MinimalEncoder.Input input, int from, boolean c40, int[] characterLength)
static void addEdges(MinimalEncoder.Input input, MinimalEncoder.Edge[][] edges, int from, MinimalEncoder.Edge previous)
static MinimalEncoder.Result encodeMinimally(MinimalEncoder.Input input)