Instances of this class are created only by CharsetDetectors.
Note
this class has a natural ordering that is inconsistent with equals. The natural ordering is based on the match confidence value.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private int | |
| private InputStream | |
| private String | |
| private byte[] | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: a negative integer, zero, or a positive integer as the confidence level of this CharsetMatch is less than, equal to, or greater than that of the argument.the CharsetMatch object to compare against. other)Implements java. |
| public int | Returns: the confidence in the charset matchGet an indication of the confidence in the charset detected. |
| public String | Returns: The ISO code for the language ornull if the language cannot be determined.Get the ISO code for the language of the detected charset. |
| public String | |
| public Reader | Returns: the Reader for the Unicode character data.Create a java.io.Reader for reading the Unicode character data corresponding to the original byte data supplied to the Charset detect operation. |
| public String | Returns: a String created from the converted input data.Create a Java String from Unicode character data corresponding to the original byte data supplied to the Charset detect operation. |
| public String | Returns: a String created from the converted input data.The maximum length of the String to be created when the
source of the data is an input stream, or -1 for
unlimited length. maxLength)Create a Java String from Unicode character data corresponding to the original byte data supplied to the Charset detect operation. |
| fCharsetName | back to summary |
|---|---|
| private String fCharsetName | |
| fConfidence | back to summary |
|---|---|
| private int fConfidence | |
| fInputStream | back to summary |
|---|---|
| private InputStream fInputStream | |
| fLang | back to summary |
|---|---|
| private String fLang | |
| fRawInput | back to summary |
|---|---|
| private byte[] fRawInput | |
| fRawLength | back to summary |
|---|---|
| private int fRawLength | |
| CharsetMatch | back to summary |
|---|---|
| pack-priv CharsetMatch(CharsetDetector det, CharsetRecognizer rec, int conf) | |
| CharsetMatch | back to summary |
|---|---|
| pack-priv CharsetMatch(CharsetDetector det, CharsetRecognizer rec, int conf, String csName, String lang) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(CharsetMatch other) Implements java. Compare to other CharsetMatch objects. Comparison is based on the match confidence value, which allows CharsetDetector.detectAll() to order its results.
| |
| getConfidence | back to summary |
|---|---|
| public int getConfidence() Get an indication of the confidence in the charset detected. Confidence values range from 0-100, with larger numbers indicating a better match of the input data to the characteristics of the charset.
| |
| getLanguage | back to summary |
|---|---|
| public String getLanguage() Get the ISO code for the language of the detected charset. | |
| getName | back to summary |
|---|---|
| public String getName() Get the name of the detected charset. The name will be one that can be used with other APIs on the platform that accept charset names. It is the "Canonical name" as defined by the class java.nio.charset.Charset; for charsets that are registered with the IANA charset registry, this is the MIME-preferred registerd name.
| |
| getReader | back to summary |
|---|---|
| public Reader getReader() Create a java.io.Reader for reading the Unicode character data corresponding to the original byte data supplied to the Charset detect operation. Caution if the source of the byte data was an InputStream, a Reader can be created for only one matching char set using this method. If more than one charset needs to be tried, the caller will need to reset the InputStream and create InputStreamReaders itself, based on the charset name. | |
| getString | back to summary |
|---|---|
| public String getString() throws IOException Create a Java String from Unicode character data corresponding to the original byte data supplied to the Charset detect operation. | |
| getString | back to summary |
|---|---|
| public String getString(int maxLength) throws IOException Create a Java String from Unicode character data corresponding to the original byte data supplied to the Charset detect operation. The length of the returned string is limited to the specified size; the string will be trunctated to this length if necessary. A limit value of zero or less is ignored, and treated as no limit. | |