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 charUnlatch from C40 encodation(package private) static final int(package private) static final charmode latch to ANSI X.12 encodation mode(package private) static final charmode latch to Base 256 encodation mode(package private) static final charmode latch to C40 encodation mode(package private) static final charmode latch to EDIFACT encodation mode(package private) static final charmode latch to Text encodation modeprivate static final char05 Macro(package private) static final String05 Macro headerprivate static final char06 Macro(package private) static final String06 Macro header(package private) static final StringMacro trailerprivate static final charPadding character(package private) static final int(package private) static final charUpper Shift(package private) static final int(package private) static final charUnlatch from X12 encodation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intdetermineConsecutiveDigitCount(CharSequence msg, int startpos) Determines the number of consecutive characters that are encodable using numeric compaction.static StringencodeHighLevel(String msg) Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).static StringencodeHighLevel(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 StringencodeHighLevel(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 intfindMinimums(float[] charCounts, int[] intCharCounts, int min, byte[] mins) private static intgetMinimumCount(byte[] mins) (package private) static voidillegalCharacter(char c) (package private) static booleanisDigit(char ch) (package private) static booleanisExtendedASCII(char ch) (package private) static booleanisNativeC40(char ch) (package private) static booleanisNativeEDIFACT(char ch) (package private) static booleanisNativeText(char ch) (package private) static booleanisNativeX12(char ch) private static booleanisSpecialB256(char ch) private static booleanisX12TermSep(char ch) (package private) static intlookAheadTest(CharSequence msg, int startpos, int currentMode) (package private) static intlookAheadTestIntern(CharSequence msg, int startpos, int currentMode) private static intmin(int f1, int f2, int f3, int f4) private static intmin(int f1, int f2, int f3, int f4, int f5) private static charrandomize253State(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
-
MACRO_06_HEADER
-
MACRO_TRAILER
-
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
-
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_SQUAREorSymbolShapeHint.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_SQUAREorSymbolShapeHint.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)
-