|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.javalanglevels.CharConverter
public abstract class CharConverter
A class full of static methods for escaping/unescaping characters. It's abstract because it should not be instantiated.
| Constructor Summary | |
|---|---|
CharConverter()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
escapeChar(char c)
Escapes the given char to be suitable for writing out in a Java char or String literal. |
static void |
escapeChar(char c,
java.lang.StringBuffer buf)
Escapes the given char to be suitable for writing out in a Java char or String literal. |
static java.lang.String |
escapeString(java.lang.String s)
Escapes the given String to be suitable for writing out as a Java String literal. |
static char |
unescapeChar(java.lang.String in)
Unescapes the given string, escaped as it would be in Java source, to a single char. |
static java.lang.String |
unescapeString(java.lang.String in)
Unescapes the given string, escaped as it would be in Java source, to a String. |
static int |
unescapeString(java.lang.String in,
int startPos,
java.lang.StringBuffer out)
Unescapes one character in the given string, escaped as it would be in Java source, to a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CharConverter()
| Method Detail |
|---|
public static java.lang.String escapeChar(char c)
c - Character to escape
public static void escapeChar(char c,
java.lang.StringBuffer buf)
c - Character to escapebuf - StringBuffer where the result is written outpublic static java.lang.String escapeString(java.lang.String s)
s - String to escape
public static char unescapeChar(java.lang.String in)
in - String containing (possibly) escaped character, without quotes
public static java.lang.String unescapeString(java.lang.String in)
in - String containing (possibly) escaped characters, without quotes
public static int unescapeString(java.lang.String in,
int startPos,
java.lang.StringBuffer out)
in - String containing (possibly) escaped charactersstartPos - Starting position of the next character to unescapeout - StringBuffer to write out the unescaped character to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||