Class HighLevelEncoder
- java.lang.Object
-
- com.google.zxing.datamatrix.encoder.HighLevelEncoder
-
public final class HighLevelEncoder extends java.lang.ObjectDataMatrix ECC 200 data encoder following the algorithm described in ISO/IEC 16022:200(E) in annex S.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intASCII_ENCODATION(package private) static intBASE256_ENCODATION(package private) static intC40_ENCODATION(package private) static charC40_UNLATCHUnlatch from C40 encodation(package private) static intEDIFACT_ENCODATION(package private) static charLATCH_TO_ANSIX12mode latch to ANSI X.12 encodation mode(package private) static charLATCH_TO_BASE256mode latch to Base 256 encodation mode(package private) static charLATCH_TO_C40mode latch to C40 encodation mode(package private) static charLATCH_TO_EDIFACTmode latch to EDIFACT encodation mode(package private) static charLATCH_TO_TEXTmode latch to Text encodation modeprivate static charMACRO_0505 Macro(package private) static java.lang.StringMACRO_05_HEADER05 Macro headerprivate static charMACRO_0606 Macro(package private) static java.lang.StringMACRO_06_HEADER06 Macro header(package private) static java.lang.StringMACRO_TRAILERMacro trailerprivate static charPADPadding character(package private) static intTEXT_ENCODATION(package private) static charUPPER_SHIFTUpper Shift(package private) static intX12_ENCODATION(package private) static charX12_UNLATCHUnlatch from X12 encodation
-
Constructor Summary
Constructors Modifier Constructor Description privateHighLevelEncoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intdetermineConsecutiveDigitCount(java.lang.CharSequence msg, int startpos)Determines the number of consecutive characters that are encodable using numeric compaction.static java.lang.StringencodeHighLevel(java.lang.String msg)Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).static java.lang.StringencodeHighLevel(java.lang.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 java.lang.StringencodeHighLevel(java.lang.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(java.lang.CharSequence msg, int startpos, int currentMode)(package private) static intlookAheadTestIntern(java.lang.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 Detail
-
PAD
private static final char PAD
Padding character- See Also:
- Constant Field Values
-
LATCH_TO_C40
static final char LATCH_TO_C40
mode latch to C40 encodation mode- See Also:
- Constant Field Values
-
LATCH_TO_BASE256
static final char LATCH_TO_BASE256
mode latch to Base 256 encodation mode- See Also:
- Constant Field Values
-
UPPER_SHIFT
static final char UPPER_SHIFT
Upper Shift- See Also:
- Constant Field Values
-
MACRO_05
private static final char MACRO_05
05 Macro- See Also:
- Constant Field Values
-
MACRO_06
private static final char MACRO_06
06 Macro- See Also:
- Constant Field Values
-
LATCH_TO_ANSIX12
static final char LATCH_TO_ANSIX12
mode latch to ANSI X.12 encodation mode- See Also:
- Constant Field Values
-
LATCH_TO_TEXT
static final char LATCH_TO_TEXT
mode latch to Text encodation mode- See Also:
- Constant Field Values
-
LATCH_TO_EDIFACT
static final char LATCH_TO_EDIFACT
mode latch to EDIFACT encodation mode- See Also:
- Constant Field Values
-
C40_UNLATCH
static final char C40_UNLATCH
Unlatch from C40 encodation- See Also:
- Constant Field Values
-
X12_UNLATCH
static final char X12_UNLATCH
Unlatch from X12 encodation- See Also:
- Constant Field Values
-
MACRO_05_HEADER
static final java.lang.String MACRO_05_HEADER
05 Macro header- See Also:
- Constant Field Values
-
MACRO_06_HEADER
static final java.lang.String MACRO_06_HEADER
06 Macro header- See Also:
- Constant Field Values
-
MACRO_TRAILER
static final java.lang.String MACRO_TRAILER
Macro trailer- See Also:
- Constant Field Values
-
ASCII_ENCODATION
static final int ASCII_ENCODATION
- See Also:
- Constant Field Values
-
C40_ENCODATION
static final int C40_ENCODATION
- See Also:
- Constant Field Values
-
TEXT_ENCODATION
static final int TEXT_ENCODATION
- See Also:
- Constant Field Values
-
X12_ENCODATION
static final int X12_ENCODATION
- See Also:
- Constant Field Values
-
EDIFACT_ENCODATION
static final int EDIFACT_ENCODATION
- See Also:
- Constant Field Values
-
BASE256_ENCODATION
static final int BASE256_ENCODATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
randomize253State
private static char randomize253State(int codewordPosition)
-
encodeHighLevel
public static java.lang.String encodeHighLevel(java.lang.String msg)
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 java.lang.String encodeHighLevel(java.lang.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 java.lang.String encodeHighLevel(java.lang.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
static int lookAheadTest(java.lang.CharSequence msg, int startpos, int currentMode)
-
lookAheadTestIntern
static int lookAheadTestIntern(java.lang.CharSequence msg, int startpos, int currentMode)
-
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
public static int determineConsecutiveDigitCount(java.lang.CharSequence msg, int startpos)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)
-
-