package com.ibm.icu.text;
import java.util.BitSet;
-import java.util.Collection;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import com.ibm.icu.lang.UCharacterCategory;
import com.ibm.icu.lang.UScript;
import com.ibm.icu.text.SpoofChecker.RestrictionLevel;
-import com.ibm.icu.text.UnicodeSet;
-import com.ibm.icu.util.Freezable;
/**
* This class analyzes a possible identifier for script and identifier status. Use it by calling setIdentifierProfile
*
* @author markdavis
* @internal
+ * @deprecated This API is ICU internal only.
*/
public class IdentifierInfo {
* Create an identifier info object. Subsequently, call {@link #setIdentifier(String)}, etc.
* {@link #setIdentifierProfile(UnicodeSet)}
* @internal
+ * @deprecated This API is ICU internal only.
*/
public IdentifierInfo() {
super();
* @param identifierProfile the characters that are to be allowed in the identifier
* @return self
* @internal
+ * @deprecated This API is ICU internal only.
*/
public IdentifierInfo setIdentifierProfile(UnicodeSet identifierProfile) {
this.identifierProfile.set(identifierProfile);
*
* @return The characters that are to be allowed in the identifier.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public UnicodeSet getIdentifierProfile() {
return new UnicodeSet(identifierProfile);
* @param identifier the identifier to analyze
* @return self
* @internal
+ * @deprecated This API is ICU internal only.
*/
public IdentifierInfo setIdentifier(String identifier) {
this.identifier = identifier;
*
* @return the identifier that was analyzed.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public String getIdentifier() {
return identifier;
*
* @return the set of explicit scripts.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public BitSet getScripts() {
return (BitSet) requiredScripts.clone();
*
* @return the set of explicit scripts.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public Set<BitSet> getAlternates() {
Set<BitSet> result = new HashSet<BitSet>();
*
* @return the set of explicit scripts.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public UnicodeSet getNumerics() {
return new UnicodeSet(numerics);
*
* @return the set of scripts that are in common among the alternates.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public BitSet getCommonAmongAlternates() {
return (BitSet) commonAmongAlternates.clone();
*
* @return the restriction level.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public RestrictionLevel getRestrictionLevel() {
if (!identifierProfile.containsAll(identifier) || getNumerics().size() > 1) {
}
/**
- * Get the number of scripts appearing in the identifier.
- * Note: Common and Inherited scripts are omitted from the count.
- * Note: If the identifier contains characters with alternate scripts
- * (the character is used with more than one script), minimize
- * the reported number of scripts by considering the character
- * to be of a script that already appears elsewhere in the identifier
- * when possible.
- * The alternate script computation may not be perfect. The distinction
- * between 0, 1 and > 1 scripts will be valid, however.
- * @return the number of scripts.
- * @internal
- */
+ * Get the number of scripts appearing in the identifier.
+ * Note: Common and Inherited scripts are omitted from the count.
+ * Note: If the identifier contains characters with alternate scripts
+ * (the character is used with more than one script), minimize
+ * the reported number of scripts by considering the character
+ * to be of a script that already appears elsewhere in the identifier
+ * when possible.
+ * The alternate script computation may not be perfect. The distinction
+ * between 0, 1 and > 1 scripts will be valid, however.
+ * @return the number of scripts.
+ * @internal
+ * @deprecated This API is ICU internal only.
+ */
public int getScriptCount() {
// Note: Common and Inherited scripts were removed by setIdentifier(), and do not appear in fRequiredScripts.
int count = requiredScripts.cardinality() +
/**
* See Object.toString()
* @internal
+ * @deprecated This API is ICU internal only.
*/
@Override
public String toString() {
* @param alternates a set of BitSets of script values.
* @return display form
* @internal
+ * @deprecated This API is ICU internal only.
*/
public static String displayAlternates(Set<BitSet> alternates) {
if (alternates.size() == 0) {
/**
* Order BitSets, first by shortest, then by items.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public static final Comparator<BitSet> BITSET_COMPARATOR = new Comparator<BitSet>() {
* Produce a readable string of a set of scripts
*
* @param scripts a BitSet of UScript values
- * @return
+ * @return a readable string of a set of scripts
* @internal
+ * @deprecated This API is ICU internal only.
*/
public static String displayScripts(BitSet scripts) {
StringBuilder result = new StringBuilder();
* @param scriptsString the string to be parsed
* @return BitSet of UScript values.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public static BitSet parseScripts(String scriptsString) {
BitSet result = new BitSet();
* @param scriptsSetString a list of alternates, separated by ;
* @return a set of BitSets of UScript values
* @internal
+ * @deprecated This API is ICU internal only.
*/
public static Set<BitSet> parseAlternates(String scriptsSetString) {
Set<BitSet> result = new HashSet<BitSet>();
* @param containee possible containee to be tested
* @return true if container contains containee
* @internal
+ * @deprecated This API is ICU internal only.
*/
public static final boolean contains(BitSet container, BitSet containee) {
for (int i = containee.nextSetBit(0); i >= 0; i = containee.nextSetBit(i + 1)) {
* @param values values to be set in the bitset
* @return modified bitset.
* @internal
+ * @deprecated This API is ICU internal only.
*/
public static final BitSet set(BitSet bitset, int... values) {
for (int value : values) {