]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/text/CharsetRecognizer.java
Upgrade ICU4J.
[Dictionary.git] / jars / icu4j-52_1 / main / classes / core / src / com / ibm / icu / text / CharsetRecognizer.java
1 /**
2 *******************************************************************************
3 * Copyright (C) 2005-2012, International Business Machines Corporation and    *
4 * others. All Rights Reserved.                                                *
5 *******************************************************************************
6 */
7 package com.ibm.icu.text;
8
9 /**
10  * Abstract class for recognizing a single charset.
11  * Part of the implementation of ICU's CharsetDetector.
12  * 
13  * Each specific charset that can be recognized will have an instance
14  * of some subclass of this class.  All interaction between the overall
15  * CharsetDetector and the stuff specific to an individual charset happens
16  * via the interface provided here.
17  * 
18  * Instances of CharsetDetector DO NOT have or maintain 
19  * state pertaining to a specific match or detect operation.
20  * The WILL be shared by multiple instances of CharsetDetector.
21  * They encapsulate const charset-specific information.
22  */
23 abstract class CharsetRecognizer {
24     /**
25      * Get the IANA name of this charset.
26      * @return the charset name.
27      */
28     abstract String      getName();
29     
30     /**
31      * Get the ISO language code for this charset.
32      * @return the language code, or <code>null</code> if the language cannot be determined.
33      */
34     public   String      getLanguage()
35     {
36         return null;
37     }
38     
39     /**
40      * Test the match of this charset with the input text data
41      *      which is obtained via the CharsetDetector object.
42      * 
43      * @param det  The CharsetDetector, which contains the input text
44      *             to be checked for being in this charset.
45      * @return     A CharsetMatch object containing details of match
46      *             with this charset, or null if there was no match.
47      */
48     abstract CharsetMatch  match(CharsetDetector det);
49
50 }