final class MinimalEncoder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
MinimalEncoder.Edge |
(package private) class |
MinimalEncoder.ResultList |
private static class |
MinimalEncoder.VersionSize |
Modifier and Type | Field and Description |
---|---|
private ErrorCorrectionLevel |
ecLevel |
private ECIEncoderSet |
encoders |
private boolean |
isGS1 |
private java.lang.String |
stringToEncode |
Constructor and Description |
---|
MinimalEncoder(java.lang.String stringToEncode,
java.nio.charset.Charset priorityCharset,
boolean isGS1,
ErrorCorrectionLevel ecLevel)
Creates a MinimalEncoder
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addEdge(MinimalEncoder.Edge[][][] edges,
int position,
MinimalEncoder.Edge edge) |
(package private) void |
addEdges(Version version,
MinimalEncoder.Edge[][][] edges,
int from,
MinimalEncoder.Edge previous) |
(package private) boolean |
canEncode(Mode mode,
char c) |
(package private) static MinimalEncoder.ResultList |
encode(java.lang.String stringToEncode,
Version version,
java.nio.charset.Charset priorityCharset,
boolean isGS1,
ErrorCorrectionLevel ecLevel)
Encodes the string minimally
|
(package private) MinimalEncoder.ResultList |
encode(Version version) |
(package private) MinimalEncoder.ResultList |
encodeSpecificVersion(Version version) |
(package private) static int |
getCompactedOrdinal(Mode mode) |
(package private) static Version |
getVersion(MinimalEncoder.VersionSize versionSize) |
(package private) static MinimalEncoder.VersionSize |
getVersionSize(Version version) |
(package private) static boolean |
isAlphanumeric(char c) |
(package private) static boolean |
isDoubleByteKanji(char c) |
(package private) static boolean |
isNumeric(char c) |
private final java.lang.String stringToEncode
private final boolean isGS1
private final ECIEncoderSet encoders
private final ErrorCorrectionLevel ecLevel
MinimalEncoder(java.lang.String stringToEncode, java.nio.charset.Charset priorityCharset, boolean isGS1, ErrorCorrectionLevel ecLevel)
stringToEncode
- The string to encodepriorityCharset
- The preferred Charset
. When the value of the argument is null, the algorithm
chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority
charset to encode any character in the input that can be encoded by it if the charset is among the
supported charsets.isGS1
- true
if a FNC1 is to be prepended; false
otherwiseecLevel
- The error correction level.MinimalEncoder.ResultList.getVersion()
static MinimalEncoder.ResultList encode(java.lang.String stringToEncode, Version version, java.nio.charset.Charset priorityCharset, boolean isGS1, ErrorCorrectionLevel ecLevel) throws WriterException
stringToEncode
- The string to encodeversion
- The preferred Version
. A minimal version is computed (see
method
when the value of the argument is nullpriorityCharset
- The preferred Charset
. When the value of the argument is null, the algorithm
chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority
charset to encode any character in the input that can be encoded by it if the charset is among the
supported charsets.isGS1
- true
if a FNC1 is to be prepended; false
otherwiseecLevel
- The error correction level.ResultList
representing the minimal solution.WriterException
MinimalEncoder.ResultList.getBits(com.google.zxing.common.BitArray)
,
MinimalEncoder.ResultList.getVersion()
,
MinimalEncoder.ResultList.getSize()
MinimalEncoder.ResultList encode(Version version) throws WriterException
WriterException
static MinimalEncoder.VersionSize getVersionSize(Version version)
static Version getVersion(MinimalEncoder.VersionSize versionSize)
static boolean isNumeric(char c)
static boolean isDoubleByteKanji(char c)
static boolean isAlphanumeric(char c)
boolean canEncode(Mode mode, char c)
static int getCompactedOrdinal(Mode mode)
void addEdge(MinimalEncoder.Edge[][][] edges, int position, MinimalEncoder.Edge edge)
void addEdges(Version version, MinimalEncoder.Edge[][][] edges, int from, MinimalEncoder.Edge previous)
MinimalEncoder.ResultList encodeSpecificVersion(Version version) throws WriterException
WriterException