Package com.google.zxing.oned
Class Code128Writer
- java.lang.Object
-
- com.google.zxing.oned.OneDimensionalCodeWriter
-
- com.google.zxing.oned.Code128Writer
-
- All Implemented Interfaces:
Writer
public final class Code128Writer extends OneDimensionalCodeWriter
This object renders a CODE128 code as aBitMatrix.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCode128Writer.CTypeprivate static classCode128Writer.MinimalEncoderEncodes minimally using Divide-And-Conquer with Memoization
-
Field Summary
Fields Modifier and Type Field Description private static intCODE_CODE_Aprivate static intCODE_CODE_Bprivate static intCODE_CODE_Cprivate static intCODE_FNC_1private static intCODE_FNC_2private static intCODE_FNC_3private static intCODE_FNC_4_Aprivate static intCODE_FNC_4_Bprivate static intCODE_START_Aprivate static intCODE_START_Bprivate static intCODE_START_Cprivate static intCODE_STOPprivate static charESCAPE_FNC_1private static charESCAPE_FNC_2private static charESCAPE_FNC_3private static charESCAPE_FNC_4
-
Constructor Summary
Constructors Constructor Description Code128Writer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intcheck(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)private static intchooseCode(java.lang.CharSequence value, int start, int oldCode)boolean[]encode(java.lang.String contents)Encode the contents to boolean array expression of one-dimensional barcode.boolean[]encode(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)Can be overwritten if the encode requires to read the hints map.private static boolean[]encodeFast(java.lang.String contents, int forcedCodeSet)private static Code128Writer.CTypefindCType(java.lang.CharSequence value, int start)protected java.util.Collection<BarcodeFormat>getSupportedWriteFormats()(package private) static boolean[]produceResult(java.util.Collection<int[]> patterns, int checkSum)-
Methods inherited from class com.google.zxing.oned.OneDimensionalCodeWriter
appendPattern, checkNumeric, encode, encode, getDefaultMargin
-
-
-
-
Field Detail
-
CODE_START_A
private static final int CODE_START_A
- See Also:
- Constant Field Values
-
CODE_START_B
private static final int CODE_START_B
- See Also:
- Constant Field Values
-
CODE_START_C
private static final int CODE_START_C
- See Also:
- Constant Field Values
-
CODE_CODE_A
private static final int CODE_CODE_A
- See Also:
- Constant Field Values
-
CODE_CODE_B
private static final int CODE_CODE_B
- See Also:
- Constant Field Values
-
CODE_CODE_C
private static final int CODE_CODE_C
- See Also:
- Constant Field Values
-
CODE_STOP
private static final int CODE_STOP
- See Also:
- Constant Field Values
-
ESCAPE_FNC_1
private static final char ESCAPE_FNC_1
- See Also:
- Constant Field Values
-
ESCAPE_FNC_2
private static final char ESCAPE_FNC_2
- See Also:
- Constant Field Values
-
ESCAPE_FNC_3
private static final char ESCAPE_FNC_3
- See Also:
- Constant Field Values
-
ESCAPE_FNC_4
private static final char ESCAPE_FNC_4
- See Also:
- Constant Field Values
-
CODE_FNC_1
private static final int CODE_FNC_1
- See Also:
- Constant Field Values
-
CODE_FNC_2
private static final int CODE_FNC_2
- See Also:
- Constant Field Values
-
CODE_FNC_3
private static final int CODE_FNC_3
- See Also:
- Constant Field Values
-
CODE_FNC_4_A
private static final int CODE_FNC_4_A
- See Also:
- Constant Field Values
-
CODE_FNC_4_B
private static final int CODE_FNC_4_B
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSupportedWriteFormats
protected java.util.Collection<BarcodeFormat> getSupportedWriteFormats()
- Overrides:
getSupportedWriteFormatsin classOneDimensionalCodeWriter
-
encode
public boolean[] encode(java.lang.String contents)
Description copied from class:OneDimensionalCodeWriterEncode the contents to boolean array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.- Specified by:
encodein classOneDimensionalCodeWriter- Parameters:
contents- barcode contents to encode- Returns:
- a
boolean[]of horizontal pixels (false = white, true = black)
-
encode
public boolean[] encode(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)Description copied from class:OneDimensionalCodeWriterCan be overwritten if the encode requires to read the hints map. Otherwise it defaults toencode.- Overrides:
encodein classOneDimensionalCodeWriter- Parameters:
contents- barcode contents to encodehints- encoding hints- Returns:
- a
boolean[]of horizontal pixels (false = white, true = black)
-
check
private static int check(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)
-
encodeFast
private static boolean[] encodeFast(java.lang.String contents, int forcedCodeSet)
-
produceResult
static boolean[] produceResult(java.util.Collection<int[]> patterns, int checkSum)
-
findCType
private static Code128Writer.CType findCType(java.lang.CharSequence value, int start)
-
chooseCode
private static int chooseCode(java.lang.CharSequence value, int start, int oldCode)
-
-