com.vgrs.xcode.cmdline.common
Class UnicodeCmdLine

java.lang.Object
  extended by com.vgrs.xcode.cmdline.CmdLine
      extended by com.vgrs.xcode.cmdline.common.UnicodeCmdLine

public class UnicodeCmdLine
extends CmdLine

This class converts between Unicode data and Utf-16 using the surrogate arithmetic specified in the UTF-16 RFC.

Version:
1.0 Aug 10, 2010
Author:
nchigurupati

Field Summary
 
Fields inherited from class com.vgrs.xcode.cmdline.CmdLine
SWITCH_FILE
 
Constructor Summary
UnicodeCmdLine(java.lang.String[] args)
           
 
Method Summary
 java.lang.String getUsageOptions()
          Return only the options for this command.
static void main(java.lang.String[] args)
           
static void testDecode(java.io.File input)
          Decode Unicode input as Utf-16.
static void testDecode(java.lang.String input)
          Decode a sequence of Unicode code points to a sequence of characters.
static void testEncode(java.io.File input)
          Encode Utf-16 input as Unicode.
static void testEncode(java.lang.String input)
          Encode a string to an array of unicode
 
Methods inherited from class com.vgrs.xcode.cmdline.CmdLine
getCommandName, getOptions, setCommandName, setOptions, showUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicodeCmdLine

public UnicodeCmdLine(java.lang.String[] args)
Parameters:
args - the command line arguments.
Method Detail

getUsageOptions

public java.lang.String getUsageOptions()
Return only the options for this command. The usage and class name are populated by the super class.

Specified by:
getUsageOptions in class CmdLine
Returns:
the usage of this command line class.

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments.

testEncode

public static void testEncode(java.io.File input)
Encode Utf-16 input as Unicode.

Parameters:
input - the file containing Utf-16 input.

testDecode

public static void testDecode(java.io.File input)
Decode Unicode input as Utf-16.

Parameters:
input - the file containing Unicode input.

testEncode

public static void testEncode(java.lang.String input)
                       throws XcodeException
Encode a string to an array of unicode

Parameters:
input - the String to be encoded.
Throws:
XcodeException - if the input array is null or empty

testDecode

public static void testDecode(java.lang.String input)
                       throws XcodeException
Decode a sequence of Unicode code points to a sequence of characters.

Parameters:
input - the String to be decoded.
Throws:
XcodeException - if the input array is null or empty


Copyright © 2000-2010 VeriSign Inc. All Rights Reserved