2 *******************************************************************************
3 * Copyright (C) 2005-2012, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 package com.ibm.icu.text;
10 * Abstract class for recognizing a single charset.
11 * Part of the implementation of ICU's CharsetDetector.
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.
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.
23 abstract class CharsetRecognizer {
25 * Get the IANA name of this charset.
26 * @return the charset name.
28 abstract String getName();
31 * Get the ISO language code for this charset.
32 * @return the language code, or <code>null</code> if the language cannot be determined.
34 public String getLanguage()
40 * Test the match of this charset with the input text data
41 * which is obtained via the CharsetDetector object.
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.
48 abstract CharsetMatch match(CharsetDetector det);