|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tools.javac.util.Convert
public class Convert
Utility class for static conversion methods between numbers and strings in various formats.
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Constructor Summary | |
---|---|
Convert()
|
Method Summary | |
---|---|
static byte[] |
chars2utf(char[] src)
Return all characters in given array as an array of bytes in Utf8 representation. |
static int |
chars2utf(char[] src,
int sindex,
byte[] dst,
int dindex,
int len)
Copy characters in source array to bytes in target array, converting them to Utf8 representation. |
static byte[] |
chars2utf(char[] src,
int sindex,
int len)
Return characters as an array of bytes in Utf8 representation. |
static List<Name> |
enclosingCandidates(Name name)
|
static java.lang.String |
escapeUnicode(java.lang.String s)
Escape all unicode characters in string. |
private static boolean |
isPrintableAscii(char ch)
Is a character printable ASCII? |
static Name |
packagePart(Name classname)
Return the package name of a class name, excluding the trailing '.', "" if not existent. |
static java.lang.String |
packagePart(java.lang.String classname)
|
static java.lang.String |
quote(char ch)
Escapes a character if it has an escape sequence or is non-printable ASCII. |
static java.lang.String |
quote(java.lang.String s)
Escapes each character in a string that has an escape sequence or is non-printable ASCII. |
static Name |
shortName(Name classname)
Return the last part of a class name. |
static java.lang.String |
shortName(java.lang.String classname)
|
static int |
string2int(java.lang.String s,
int radix)
Convert string to integer. |
static long |
string2long(java.lang.String s,
int radix)
Convert string to long integer. |
static byte[] |
string2utf(java.lang.String s)
Return string as an array of bytes in in Utf8 representation. |
static char[] |
utf2chars(byte[] src)
Return all bytes of a given array in Utf8 representation as an array of characters. |
static int |
utf2chars(byte[] src,
int sindex,
char[] dst,
int dindex,
int len)
Convert `len' bytes from utf8 to characters. |
static char[] |
utf2chars(byte[] src,
int sindex,
int len)
Return bytes in Utf8 representation as an array of characters. |
static java.lang.String |
utf2string(byte[] src)
Return all bytes of a given array in Utf8 representation as a string. |
static java.lang.String |
utf2string(byte[] src,
int sindex,
int len)
Return bytes in Utf8 representation as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Convert()
Method Detail |
---|
public static int string2int(java.lang.String s, int radix) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static long string2long(java.lang.String s, int radix) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static int utf2chars(byte[] src, int sindex, char[] dst, int dindex, int len)
src
- The array holding the bytes to convert.sindex
- The start index from which bytes are converted.dst
- The array holding the converted characters..dindex
- The start index from which converted characters
are written.len
- The maximum number of bytes to convert.public static char[] utf2chars(byte[] src, int sindex, int len)
src
- The array holding the bytes.sindex
- The start index from which bytes are converted.len
- The maximum number of bytes to convert.public static char[] utf2chars(byte[] src)
src
- The array holding the bytes.public static java.lang.String utf2string(byte[] src, int sindex, int len)
src
- The array holding the bytes.sindex
- The start index from which bytes are converted.len
- The maximum number of bytes to convert.public static java.lang.String utf2string(byte[] src)
src
- The array holding the bytes.public static int chars2utf(char[] src, int sindex, byte[] dst, int dindex, int len)
src
- The array holding the characters to convert.sindex
- The start index from which characters are converted.dst
- The array holding the converted characters..dindex
- The start index from which converted bytes
are written.len
- The maximum number of characters to convert.public static byte[] chars2utf(char[] src, int sindex, int len)
src
- The array holding the characters.sindex
- The start index from which characters are converted.len
- The maximum number of characters to convert.public static byte[] chars2utf(char[] src)
src
- The array holding the characters.public static byte[] string2utf(java.lang.String s)
public static java.lang.String quote(java.lang.String s)
public static java.lang.String quote(char ch)
private static boolean isPrintableAscii(char ch)
public static java.lang.String escapeUnicode(java.lang.String s)
public static Name shortName(Name classname)
public static java.lang.String shortName(java.lang.String classname)
public static Name packagePart(Name classname)
public static java.lang.String packagePart(java.lang.String classname)
public static List<Name> enclosingCandidates(Name name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |