Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/text/normalizer/SymbolTable.java
38830 views
/*1* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/*26*******************************************************************************27* (C) Copyright IBM Corp. 1996-2005 - All Rights Reserved *28* *29* The original version of this source code and documentation is copyrighted *30* and owned by IBM, These materials are provided under terms of a License *31* Agreement between IBM and Sun. This technology is protected by multiple *32* US and International patents. This notice and attribution to IBM may not *33* to removed. *34*******************************************************************************35*/3637package sun.text.normalizer;3839import java.text.ParsePosition;4041/**42* An interface that defines both lookup protocol and parsing of43* symbolic names.44*45* <p>A symbol table maintains two kinds of mappings. The first is46* between symbolic names and their values. For example, if the47* variable with the name "start" is set to the value "alpha"48* (perhaps, though not necessarily, through an expression such as49* "$start=alpha"), then the call lookup("start") will return the50* char[] array ['a', 'l', 'p', 'h', 'a'].51*52* <p>The second kind of mapping is between character values and53* UnicodeMatcher objects. This is used by RuleBasedTransliterator,54* which uses characters in the private use area to represent objects55* such as UnicodeSets. If U+E015 is mapped to the UnicodeSet [a-z],56* then lookupMatcher(0xE015) will return the UnicodeSet [a-z].57*58* <p>Finally, a symbol table defines parsing behavior for symbolic59* names. All symbolic names start with the SYMBOL_REF character.60* When a parser encounters this character, it calls parseReference()61* with the position immediately following the SYMBOL_REF. The symbol62* table parses the name, if there is one, and returns it.63*64* @draft ICU 2.865* @deprecated This is a draft API and might change in a future release of ICU.66*/67@Deprecated68public interface SymbolTable {6970/**71* The character preceding a symbol reference name.72* @draft ICU 2.873* @deprecated This is a draft API and might change in a future release of ICU.74*/75@Deprecated76static final char SYMBOL_REF = '$';7778/**79* Lookup the characters associated with this string and return it.80* Return <tt>null</tt> if no such name exists. The resultant81* array may have length zero.82* @param s the symbolic name to lookup83* @return a char array containing the name's value, or null if84* there is no mapping for s.85* @draft ICU 2.886* @deprecated This is a draft API and might change in a future release of ICU.87*/88@Deprecated89char[] lookup(String s);9091/**92* Lookup the UnicodeMatcher associated with the given character, and93* return it. Return <tt>null</tt> if not found.94* @param ch a 32-bit code point from 0 to 0x10FFFF inclusive.95* @return the UnicodeMatcher object represented by the given96* character, or null if there is no mapping for ch.97* @draft ICU 2.898* @deprecated This is a draft API and might change in a future release of ICU.99*/100@Deprecated101UnicodeMatcher lookupMatcher(int ch);102103/**104* Parse a symbol reference name from the given string, starting105* at the given position. If no valid symbol reference name is106* found, return null and leave pos unchanged. That is, if the107* character at pos cannot start a name, or if pos is at or after108* text.length(), then return null. This indicates an isolated109* SYMBOL_REF character.110* @param text the text to parse for the name111* @param pos on entry, the index of the first character to parse.112* This is the character following the SYMBOL_REF character. On113* exit, the index after the last parsed character. If the parse114* failed, pos is unchanged on exit.115* @param limit the index after the last character to be parsed.116* @return the parsed name, or null if there is no valid symbolic117* name at the given position.118* @draft ICU 2.8119* @deprecated This is a draft API and might change in a future release of ICU.120*/121@Deprecated122String parseReference(String text, ParsePosition pos, int limit);123}124125126