Package com.google.zxing.aztec.encoder
Class HighLevelEncoder
java.lang.Object
com.google.zxing.aztec.encoder.HighLevelEncoder
This produces nearly optimal encodings of text into the first-level of
encoding used by Aztec code.
It uses a dynamic algorithm. For each prefix of the string, it determines
a set of encodings that could lead to this prefix. We repeatedly add a
character and generate a new set of optimal encodings until we have read
through the entire input.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[][]
private final Charset
(package private) static final int[][]
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final String[]
(package private) static final int
(package private) static final int
(package private) static final int[][]
private final byte[]
-
Constructor Summary
ConstructorsConstructorDescriptionHighLevelEncoder
(byte[] text) HighLevelEncoder
(byte[] text, Charset charset) -
Method Summary
Modifier and TypeMethodDescriptionencode()
private static Collection
<State> simplifyStates
(Iterable<State> states) private void
updateStateForChar
(State state, int index, Collection<State> result) private static void
updateStateForPair
(State state, int index, int pairCode, Collection<State> result) private Collection
<State> updateStateListForChar
(Iterable<State> states, int index) private static Collection
<State> updateStateListForPair
(Iterable<State> states, int index, int pairCode)
-
Field Details
-
MODE_NAMES
-
MODE_UPPER
static final int MODE_UPPER- See Also:
-
MODE_LOWER
static final int MODE_LOWER- See Also:
-
MODE_DIGIT
static final int MODE_DIGIT- See Also:
-
MODE_MIXED
static final int MODE_MIXED- See Also:
-
MODE_PUNCT
static final int MODE_PUNCT- See Also:
-
LATCH_TABLE
static final int[][] LATCH_TABLE -
CHAR_MAP
private static final int[][] CHAR_MAP -
SHIFT_TABLE
static final int[][] SHIFT_TABLE -
text
private final byte[] text -
charset
-
-
Constructor Details
-
HighLevelEncoder
public HighLevelEncoder(byte[] text) -
HighLevelEncoder
-
-
Method Details
-
encode
- Returns:
- text represented by this encoder encoded as a
BitArray
-
updateStateListForChar
-
updateStateForChar
-
updateStateListForPair
private static Collection<State> updateStateListForPair(Iterable<State> states, int index, int pairCode) -
updateStateForPair
private static void updateStateForPair(State state, int index, int pairCode, Collection<State> result) -
simplifyStates
-