|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vgrs.xcode.common.unicodedata.UnicodeData
public class UnicodeData
This class will read and store all the relevant Unicode data files into memory. It also implements the algorithm defined in IDNA2008 Tables document to assign a Unicode category for each code point. This class has all the data needed to implement the IDNA 2008 protocol.
Cleaned up the code to use GNU Trove collections, refactored the common code and comments to all the variables and methods.
| Constructor Summary | |
|---|---|
UnicodeData()
|
|
| Method Summary | |
|---|---|
static void |
assertNoDisallowedOrUnassignedCodePoints(int[] aCodePoints)
Assert that none of the code points are either UNASSIGNED or DISALLOWED. |
static void |
assertNormalized(int[] aCodePoints)
Assert that the given set of code points are in NFC normalized form. |
static java.lang.String |
getBidiClass(int aCodePoint)
|
static TIntObjectMap<java.lang.String> |
getBidiClassTable()
Returns the Bidi Class Table |
static int |
getCanonicalClass(int aCodePoint)
The canonical combining class value of the code point or 0 if not found |
static TIntIntMap |
getCanonicalClassTable()
Returns the canonicalClassTable |
static int |
getCanonicalCombiningClass(int aCodePoint)
Returns the canonical combining class value for the given code point |
static UnicodeCodePointCategory |
getCodePointDerivedProperty(int aCodePoint)
|
static TIntSet |
getCombiningMarkTable()
Returns the combiningMark table |
static TIntSet |
getCompatibilityTable()
Returns the compatibilityTable |
static TLongIntMap |
getComposeTable()
Returns the composeTable |
static TIntSet |
getContextualCodePointsTable()
Returns the contextualCodePoints |
static TIntObjectMap<int[]> |
getDecomposeTable()
Returns the decomposeTable |
static TIntCharMap |
getDerivedJoiningTypeTable()
Returns the derivedJoiningTypeTable |
static java.lang.String |
getGeneralCategory(int aCodePoint)
|
static TIntObjectMap<java.lang.String> |
getGeneralCategoryTable()
Returns the General Category table |
static char |
getJoiningType(int aCodePoint)
|
static java.lang.String |
getScript(int aCodePoint)
|
static TIntObjectMap<java.lang.String> |
getScriptsTable()
Returns the scriptsTable |
static boolean |
hasContextualCodePoints(int[] aCodePoints)
Checks to see if there are any contextual (CONTEXTO/CONTEXTJ) code points present |
static void |
init()
Initialize all the data structures in this class with data read and parsed from Unicode data files. |
static boolean |
isCombiningMark(int aCodePoint)
|
static boolean |
isDisallowedOrUnassignedCodePoint(int aCodePoint)
|
static int |
isNormalizationNeeded(int[] aCodePoints)
This method performs a quick check to see if the given code points can be normalized or not. |
static boolean |
isNormalized(int[] aCodePoints)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnicodeData()
| Method Detail |
|---|
public static void init()
throws XcodeException
XcodeExceptionpublic static boolean isCombiningMark(int aCodePoint)
aCodePoint -
public static java.lang.String getScript(int aCodePoint)
aCodePoint -
public static java.lang.String getBidiClass(int aCodePoint)
aCodePoint -
public static char getJoiningType(int aCodePoint)
aCodePoint -
public static void assertNoDisallowedOrUnassignedCodePoints(int[] aCodePoints)
throws XcodeException
aCodePoints - an int[] array of Unicode code points.
XcodeException - if any of the Unicode code points are either UNASSIGNED or
DISALLOWEDpublic static boolean isDisallowedOrUnassignedCodePoint(int aCodePoint)
public static boolean isNormalized(int[] aCodePoints)
aCodePoints - the Unicode code points
XcodeException
public static void assertNormalized(int[] aCodePoints)
throws XcodeException
aCodePoints - the Unicode code points
XcodeException - if the given set of code points are not in Normalization Form C
(NFC [Unicode-UAX15])public static int isNormalizationNeeded(int[] aCodePoints)
If the value of a code point has a derived core property of "NFC_QC_N" then the code points cannot be normalized.
If the value of a code point has a derived core property of "NFC_QC_M" then the code points have to be normalized.
Otherwise, the code points are already in NFC normalized form.
aCodePoints - the Unicode code points
0 - means given set contains code points with NFC_QC with value “N”
1 - means given set contains code points with NFC_QC with value “Y"
2 - means given set contains code points with NFC_QC with value “M"
XcodeExceptionpublic static int getCanonicalClass(int aCodePoint)
aCodePoint -
public static boolean hasContextualCodePoints(int[] aCodePoints)
aCodePoints -
public static UnicodeCodePointCategory getCodePointDerivedProperty(int aCodePoint)
public static final int getCanonicalCombiningClass(int aCodePoint)
aCodePoint -
public static final TIntSet getCompatibilityTable()
public static final TIntIntMap getCanonicalClassTable()
public static final TLongIntMap getComposeTable()
public static final TIntObjectMap<int[]> getDecomposeTable()
public static final java.lang.String getGeneralCategory(int aCodePoint)
aCodePoint -
public static TIntSet getContextualCodePointsTable()
public static TIntObjectMap<java.lang.String> getScriptsTable()
public static TIntCharMap getDerivedJoiningTypeTable()
public static TIntObjectMap<java.lang.String> getBidiClassTable()
public static TIntObjectMap<java.lang.String> getGeneralCategoryTable()
public static TIntSet getCombiningMarkTable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||