Package com.google.zxing.aztec.encoder
Class HighLevelEncoder
- java.lang.Object
-
- com.google.zxing.aztec.encoder.HighLevelEncoder
-
public final class HighLevelEncoder extends java.lang.Object
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
Fields Modifier and Type Field Description private static int[][]
CHAR_MAP
private java.nio.charset.Charset
charset
(package private) static int[][]
LATCH_TABLE
(package private) static int
MODE_DIGIT
(package private) static int
MODE_LOWER
(package private) static int
MODE_MIXED
(package private) static java.lang.String[]
MODE_NAMES
(package private) static int
MODE_PUNCT
(package private) static int
MODE_UPPER
(package private) static int[][]
SHIFT_TABLE
private byte[]
text
-
Constructor Summary
Constructors Constructor Description HighLevelEncoder(byte[] text)
HighLevelEncoder(byte[] text, java.nio.charset.Charset charset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BitArray
encode()
private static java.util.Collection<State>
simplifyStates(java.lang.Iterable<State> states)
private void
updateStateForChar(State state, int index, java.util.Collection<State> result)
private static void
updateStateForPair(State state, int index, int pairCode, java.util.Collection<State> result)
private java.util.Collection<State>
updateStateListForChar(java.lang.Iterable<State> states, int index)
private static java.util.Collection<State>
updateStateListForPair(java.lang.Iterable<State> states, int index, int pairCode)
-
-
-
Field Detail
-
MODE_NAMES
static final java.lang.String[] MODE_NAMES
-
MODE_UPPER
static final int MODE_UPPER
- See Also:
- Constant Field Values
-
MODE_LOWER
static final int MODE_LOWER
- See Also:
- Constant Field Values
-
MODE_DIGIT
static final int MODE_DIGIT
- See Also:
- Constant Field Values
-
MODE_MIXED
static final int MODE_MIXED
- See Also:
- Constant Field Values
-
MODE_PUNCT
static final int MODE_PUNCT
- See Also:
- Constant Field Values
-
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
private final java.nio.charset.Charset charset
-
-
Method Detail
-
updateStateListForChar
private java.util.Collection<State> updateStateListForChar(java.lang.Iterable<State> states, int index)
-
updateStateForChar
private void updateStateForChar(State state, int index, java.util.Collection<State> result)
-
updateStateListForPair
private static java.util.Collection<State> updateStateListForPair(java.lang.Iterable<State> states, int index, int pairCode)
-
updateStateForPair
private static void updateStateForPair(State state, int index, int pairCode, java.util.Collection<State> result)
-
-