public final class QrSegmentAdvanced extends Object
| Constructor and Description |
|---|
QrSegmentAdvanced() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isEncodableAsKanji(String text)
Tests whether the specified text string can be encoded as a segment in kanji mode.
|
static QrSegment |
makeKanjiSegment(String text)
Returns a segment representing the specified string encoded in kanji mode.
|
static List<QrSegment> |
makeSegmentsOptimally(String text,
QrCode.Ecc ecl,
int minVersion,
int maxVersion)
Returns a new mutable list of zero or more segments to represent the specified Unicode text string.
|
public static List<QrSegment> makeSegmentsOptimally(String text, QrCode.Ecc ecl, int minVersion, int maxVersion)
This function can be viewed as a significantly more sophisticated and slower replacement
for QrSegment.makeSegments(String), but requiring more input parameters in a way
that overlaps with QrCode.encodeSegments(List,QrCode.Ecc,int,int,int,boolean).
text - the text to be encoded, which can be any Unicode stringecl - the error correction level to useminVersion - the minimum allowed version of the QR symbol (at least 1)maxVersion - the maximum allowed version of the QR symbol (at most 40)NullPointerException - if the data or error correction level is nullIllegalArgumentException - if 1 ≤ minVersion ≤ maxVersion ≤ 40 is violated,
or if the data is too long to fit in a QR Code at maxVersion at the ECLpublic static QrSegment makeKanjiSegment(String text)
Note that broadly speaking, the set of encodable characters are {kanji used in Japan, hiragana, katakana,
Asian punctuation, full-width ASCII}.
In particular, non-encodable characters are {normal ASCII, half-width katakana, more extensive Chinese hanzi}.
text - the text to be encoded, which must fall in the kanji mode subset of charactersNullPointerException - if the string is nullIllegalArgumentException - if the string contains non-kanji-mode charactersisEncodableAsKanji(String)public static boolean isEncodableAsKanji(String text)
Note that broadly speaking, the set of encodable characters are {kanji used in Japan, hiragana, katakana,
Asian punctuation, full-width ASCII}.
In particular, non-encodable characters are {normal ASCII, half-width katakana, more extensive Chinese hanzi}.
text - the string to test for encodabilitytrue if and only if the string can be encoded in kanji modeNullPointerException - if the string is nullmakeKanjiSegment(String)Copyright © 2018. All rights reserved.