|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsdsi.sexp.Sexp
Abstract S-expression superclass. Provides static utility functions. S-expressions are immutable.
SexpString
,
SexpList
,
Serialized FormField Summary | |
static char[] |
base64Digit
Maps integers to base-64 digits. |
static char[] |
hexDigit
Maps integers to hexadecimal digits. |
Constructor Summary | |
Sexp()
|
Method Summary | |
static java.lang.String |
decodeString(byte[] b)
Converts a byte array to a string using the 8859_1 encoding. |
static byte[] |
encodeString(java.lang.String s)
Converts a string to a byte array using the 8859_1 encoding. |
static java.lang.String |
getEncoding()
Returns the character encoding for S-expressions (8859_1). |
int |
getReadableLen()
Returns the length of this S-expression as if it were printed on one line. |
static boolean |
isBase64Digit(int c)
Tests if a character is a base 64 digit. |
static boolean |
isDecimalDigit(int c)
Tests if a character is a decimal digit. |
static boolean |
isHexDigit(int c)
Tests if a character is a hexadecimal digit. |
static boolean |
isTokenChar(int c)
Tests if a character is a token character. |
static boolean |
isWhiteSpace(int c)
Tests if a character is whitespace. |
abstract void |
writeCanonical(java.io.OutputStream out)
Writes this S-expression to a byte stream in canonical form. |
abstract void |
writeReadable(java.io.Writer out,
int offset,
int width,
int last)
Writes this S-expression to a character stream in readable form. |
void |
writeTransport(java.io.OutputStream out)
Writes this S-expression to a byte stream in transport form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char[] hexDigit
public static final char[] base64Digit
Constructor Detail |
public Sexp()
Method Detail |
public static final java.lang.String getEncoding()
public static final boolean isWhiteSpace(int c)
c
- the character to be tested
true
if the character is whitespace, false
otherwisepublic static final boolean isDecimalDigit(int c)
c
- the character to be tested
true
if the character is a digit between 0 and 9
inclusive, false
otherwisepublic static final boolean isHexDigit(int c)
c
- the character to be tested.
true
if the character is a decimal digit or a
letter between 'a' and 'f' upper or lowercase, false
otherwise .public static final boolean isBase64Digit(int c)
c
- the character to be tested.
true
if the character is a decimal digit, a
letter of the alphabet or '+' or '/', false
otherwise.public static final boolean isTokenChar(int c)
c
- the character to be tested.
true
if the character is a legal token character
for an S-expression, false
otherwise.public static java.lang.String decodeString(byte[] b)
public static byte[] encodeString(java.lang.String s)
public abstract void writeCanonical(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public final void writeTransport(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public abstract void writeReadable(java.io.Writer out, int offset, int width, int last) throws java.io.IOException
offset
- spaces indented from left.width
- total width of window, in characters.last
- spaces reserved on right (e.g., for closing parens).
java.io.IOException
public final int getReadableLen()
#getReadableLenImpl()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |