com.vgrs.xcode.common.unicodedata
Class UnicodeDataFileUtil

java.lang.Object
  extended by com.vgrs.xcode.common.unicodedata.UnicodeDataFileUtil

public class UnicodeDataFileUtil
extends java.lang.Object

Unicode data files come in a variety of different formats. Rather than clutter and/or repeat the code to read data from Unicode data files, the utility methods to read from a variety of different Unicode data file formats are present in this class.

Version:
1.0 Jun 10, 2010
Author:
nchigurupati

Constructor Summary
UnicodeDataFileUtil()
           
 
Method Summary
static java.util.List<Range> getRanges(java.lang.String resource)
          Read Unicode data from a file, return a List of Range objects.
static void loadCodePointAndCategoryCharMap(java.lang.String aFileName, TIntCharMap aMap, java.lang.String[] delimiters, java.util.Set<java.lang.String> aPropertiesToLoad)
          Loads a code point and it's corresponding property into a TIntCharMap.
static void loadCodePointAndCategoryMap(java.lang.String aFileName, TIntObjectMap<java.lang.String> aMap, java.lang.String[] delimiters, java.util.Set<java.lang.String> aPropertiesToLoad)
          Loads a code point and it's corresponding property into a TIntObjectMap.
static void loadCodePointAndCategoryMap(java.lang.String aFileName, TIntObjectMap<java.lang.String> aMap, java.lang.String aDelimiter, java.util.Set<java.lang.String> aPropertiesToLoad)
          Loads a code point and it's corresponding property into a TIntObjectMap.
static void loadCodePointAndCategorySet(java.lang.String aFileName, TIntObjectMap<java.util.Set<java.lang.String>> aMap, java.lang.String[] delimiters)
          Loads a code point and it's corresponding property into a TIntObjectMap>.
static void loadCodePointSet(java.lang.String aFileName, TIntSet aSet, java.lang.String aDelimiter)
          Loads a code point and it's corresponding property into a TIntSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicodeDataFileUtil

public UnicodeDataFileUtil()
Method Detail

loadCodePointAndCategoryMap

public static void loadCodePointAndCategoryMap(java.lang.String aFileName,
                                               TIntObjectMap<java.lang.String> aMap,
                                               java.lang.String aDelimiter,
                                               java.util.Set<java.lang.String> aPropertiesToLoad)
                                        throws XcodeException
Loads a code point and it's corresponding property into a TIntObjectMap. Data read from the file is tokenized using the given delimiter parameter. Properties that are present in the Set aPropertiesToLoad are loaded into the collection.

Parameters:
aFileName - The file from which to load the code points and the corresponding property into a TIntObjectMap object.
aMap - TIntObjectMap object
aDelimiter - The delimiter to tokenize the data read from the data file.
aPropertiesToLoad - Load only properties specified in this set.
Throws:
XcodeException

loadCodePointAndCategorySet

public static void loadCodePointAndCategorySet(java.lang.String aFileName,
                                               TIntObjectMap<java.util.Set<java.lang.String>> aMap,
                                               java.lang.String[] delimiters)
                                        throws XcodeException
Loads a code point and it's corresponding property into a TIntObjectMap>. Data read from the file is tokenized using the given delimiters parameter.

Parameters:
aFileName - The file from which to load the code points and the corresponding property into a TIntObjectMap object.
aMap - TIntObjectMap> object
delimiters - The delimiters to tokenize the data read from the data file in order.
Throws:
XcodeException

loadCodePointAndCategoryMap

public static void loadCodePointAndCategoryMap(java.lang.String aFileName,
                                               TIntObjectMap<java.lang.String> aMap,
                                               java.lang.String[] delimiters,
                                               java.util.Set<java.lang.String> aPropertiesToLoad)
                                        throws XcodeException
Loads a code point and it's corresponding property into a TIntObjectMap. Data read from the file is tokenized using the given delimiters parameter. Properties that are present in the Set aPropertiesToLoad are loaded into the collection.

Parameters:
aFileName - The file from which to load the code points and the corresponding property into a TIntObjectMap object.
aMap - TIntObjectMap object
delimiters - The delimiter to tokenize the data read from the data file.
aPropertiesToLoad - Load only properties specified in this set.
Throws:
XcodeException

loadCodePointAndCategoryCharMap

public static void loadCodePointAndCategoryCharMap(java.lang.String aFileName,
                                                   TIntCharMap aMap,
                                                   java.lang.String[] delimiters,
                                                   java.util.Set<java.lang.String> aPropertiesToLoad)
                                            throws XcodeException
Loads a code point and it's corresponding property into a TIntCharMap. Data read from the file is tokenized using the given delimiters parameter. Properties that are present in the Set aPropertiesToLoad are loaded into the collection.

Parameters:
aFileName - The file from which to load the code points and the corresponding property into a TIntObjectMap object.
aMap - TIntCharMap object
delimiters - The delimiters to tokenize the data read from the data file.
aPropertiesToLoad - Load only properties specified in this set.
Throws:
XcodeException

loadCodePointSet

public static void loadCodePointSet(java.lang.String aFileName,
                                    TIntSet aSet,
                                    java.lang.String aDelimiter)
                             throws XcodeException
Loads a code point and it's corresponding property into a TIntSet. Data read from the file is tokenized using the given delimiter parameter.

Parameters:
aFileName - The file from which to load the code points and the corresponding property into a TIntSet object.
aSet - TIntSet object into which the code points read should be added.
aDelimiter - The delimiter to tokenize the data read from the data file.
Throws:
XcodeException

getRanges

public static java.util.List<Range> getRanges(java.lang.String resource)
                                       throws XcodeException
Read Unicode data from a file, return a List of Range objects.

Parameters:
resource - The resource containing Unicode data.
Throws:
XcodeException - If the file does not exist or has invalid format.


Copyright © 2000-2010 VeriSign Inc. All Rights Reserved