Class HighLevelEncoder
java.lang.Object
com.google.zxing.datamatrix.encoder.HighLevelEncoder
DataMatrix ECC 200 data encoder following the algorithm described in ISO/IEC 16022:200(E) in
annex S.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final char
Unlatch from C40 encodation(package private) static final int
(package private) static final char
mode latch to ANSI X.12 encodation mode(package private) static final char
mode latch to Base 256 encodation mode(package private) static final char
mode latch to C40 encodation mode(package private) static final char
mode latch to EDIFACT encodation mode(package private) static final char
mode latch to Text encodation modeprivate static final char
05 Macro(package private) static final String
05 Macro headerprivate static final char
06 Macro(package private) static final String
06 Macro header(package private) static final String
Macro trailerprivate static final char
Padding character(package private) static final int
(package private) static final char
Upper Shift(package private) static final int
(package private) static final char
Unlatch from X12 encodation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
determineConsecutiveDigitCount
(CharSequence msg, int startpos) Determines the number of consecutive characters that are encodable using numeric compaction.static String
encodeHighLevel
(String msg) Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).static String
encodeHighLevel
(String msg, SymbolShapeHint shape, Dimension minSize, Dimension maxSize) Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).static String
encodeHighLevel
(String msg, SymbolShapeHint shape, Dimension minSize, Dimension maxSize, boolean forceC40) Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).private static int
findMinimums
(float[] charCounts, int[] intCharCounts, int min, byte[] mins) private static int
getMinimumCount
(byte[] mins) (package private) static void
illegalCharacter
(char c) (package private) static boolean
isDigit
(char ch) (package private) static boolean
isExtendedASCII
(char ch) (package private) static boolean
isNativeC40
(char ch) (package private) static boolean
isNativeEDIFACT
(char ch) (package private) static boolean
isNativeText
(char ch) (package private) static boolean
isNativeX12
(char ch) private static boolean
isSpecialB256
(char ch) private static boolean
isX12TermSep
(char ch) (package private) static int
lookAheadTest
(CharSequence msg, int startpos, int currentMode) (package private) static int
lookAheadTestIntern
(CharSequence msg, int startpos, int currentMode) private static int
min
(int f1, int f2, int f3, int f4) private static int
min
(int f1, int f2, int f3, int f4, int f5) private static char
randomize253State
(int codewordPosition)
-
Field Details
-
PAD
private static final char PADPadding character- See Also:
-
LATCH_TO_C40
static final char LATCH_TO_C40mode latch to C40 encodation mode- See Also:
-
LATCH_TO_BASE256
static final char LATCH_TO_BASE256mode latch to Base 256 encodation mode- See Also:
-
UPPER_SHIFT
static final char UPPER_SHIFTUpper Shift- See Also:
-
MACRO_05
private static final char MACRO_0505 Macro- See Also:
-
MACRO_06
private static final char MACRO_0606 Macro- See Also:
-
LATCH_TO_ANSIX12
static final char LATCH_TO_ANSIX12mode latch to ANSI X.12 encodation mode- See Also:
-
LATCH_TO_TEXT
static final char LATCH_TO_TEXTmode latch to Text encodation mode- See Also:
-
LATCH_TO_EDIFACT
static final char LATCH_TO_EDIFACTmode latch to EDIFACT encodation mode- See Also:
-
C40_UNLATCH
static final char C40_UNLATCHUnlatch from C40 encodation- See Also:
-
X12_UNLATCH
static final char X12_UNLATCHUnlatch from X12 encodation- See Also:
-
MACRO_05_HEADER
05 Macro header- See Also:
-
MACRO_06_HEADER
06 Macro header- See Also:
-
MACRO_TRAILER
Macro trailer- See Also:
-
ASCII_ENCODATION
static final int ASCII_ENCODATION- See Also:
-
C40_ENCODATION
static final int C40_ENCODATION- See Also:
-
TEXT_ENCODATION
static final int TEXT_ENCODATION- See Also:
-
X12_ENCODATION
static final int X12_ENCODATION- See Also:
-
EDIFACT_ENCODATION
static final int EDIFACT_ENCODATION- See Also:
-
BASE256_ENCODATION
static final int BASE256_ENCODATION- See Also:
-
-
Constructor Details
-
HighLevelEncoder
private HighLevelEncoder()
-
-
Method Details
-
randomize253State
private static char randomize253State(int codewordPosition) -
encodeHighLevel
Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).- Parameters:
msg
- the message- Returns:
- the encoded message (the char values range from 0 to 255)
-
encodeHighLevel
public static String encodeHighLevel(String msg, SymbolShapeHint shape, Dimension minSize, Dimension maxSize) Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).- Parameters:
msg
- the messageshape
- requested shape. May beSymbolShapeHint.FORCE_NONE
,SymbolShapeHint.FORCE_SQUARE
orSymbolShapeHint.FORCE_RECTANGLE
.minSize
- the minimum symbol size constraint or null for no constraintmaxSize
- the maximum symbol size constraint or null for no constraint- Returns:
- the encoded message (the char values range from 0 to 255)
-
encodeHighLevel
public static String encodeHighLevel(String msg, SymbolShapeHint shape, Dimension minSize, Dimension maxSize, boolean forceC40) Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).- Parameters:
msg
- the messageshape
- requested shape. May beSymbolShapeHint.FORCE_NONE
,SymbolShapeHint.FORCE_SQUARE
orSymbolShapeHint.FORCE_RECTANGLE
.minSize
- the minimum symbol size constraint or null for no constraintmaxSize
- the maximum symbol size constraint or null for no constraintforceC40
- enforce C40 encoding- Returns:
- the encoded message (the char values range from 0 to 255)
-
lookAheadTest
-
lookAheadTestIntern
-
min
private static int min(int f1, int f2, int f3, int f4, int f5) -
min
private static int min(int f1, int f2, int f3, int f4) -
findMinimums
private static int findMinimums(float[] charCounts, int[] intCharCounts, int min, byte[] mins) -
getMinimumCount
private static int getMinimumCount(byte[] mins) -
isDigit
static boolean isDigit(char ch) -
isExtendedASCII
static boolean isExtendedASCII(char ch) -
isNativeC40
static boolean isNativeC40(char ch) -
isNativeText
static boolean isNativeText(char ch) -
isNativeX12
static boolean isNativeX12(char ch) -
isX12TermSep
private static boolean isX12TermSep(char ch) -
isNativeEDIFACT
static boolean isNativeEDIFACT(char ch) -
isSpecialB256
private static boolean isSpecialB256(char ch) -
determineConsecutiveDigitCount
Determines the number of consecutive characters that are encodable using numeric compaction.- Parameters:
msg
- the messagestartpos
- the start position within the message- Returns:
- the requested character count
-
illegalCharacter
static void illegalCharacter(char c)
-