|
||||||||||
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. |
int |
getReadableLen()
Returns the length of this S-expression as if it were printed on one line. |
(package private) abstract int |
getReadableLenImpl()
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. |
(package private) static void |
writeBase64(byte[] data,
java.io.Writer out)
Encodes data in base-64 and writes it to a character stream. |
(package private) static void |
writeBase64(byte[] data,
java.io.Writer out,
int offset,
int width,
int last)
Encodes data in base-64 and writes it to a character stream. |
abstract void |
writeCanonical(java.io.OutputStream out)
Writes this S-expression to a byte stream in canonical form. |
(package private) static void |
writeHex(byte[] data,
java.io.Writer out)
Encodes data in hexadecimal and writes it to a character stream. |
(package private) static void |
writeHex(byte[] data,
java.io.Writer out,
int offset,
int width,
int last)
Encodes data in hexadecimal and writes it to a character stream. |
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 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
otherwisepublic 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
otherwisepublic 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
otherwisestatic void writeHex(byte[] data, java.io.Writer out) throws java.io.IOException
data
- the data to encodeout
- the character stream
java.io.IOException
static void writeHex(byte[] data, java.io.Writer out, int offset, int width, int last) throws java.io.IOException
data
- the data to encodeout
- the character streamoffset
- spaces indented from leftwidth
- total width of window, in characterslast
- spaces reserved on right (e.g., for closing parens)
java.io.IOException
static void writeBase64(byte[] data, java.io.Writer out) throws java.io.IOException
data
- the data to encodeout
- the character stream
java.io.IOException
static void writeBase64(byte[] data, java.io.Writer out, int offset, int width, int last) throws java.io.IOException
data
- the data to encodeout
- the character streamoffset
- spaces indented from leftwidth
- total width of window, in characterslast
- spaces reserved on right (e.g., for closing parens)
java.io.IOException
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 leftwidth
- total width of window, in characterslast
- spaces reserved on right (e.g., for closing parens)
java.io.IOException
public final int getReadableLen()
getReadableLenImpl()
abstract int getReadableLenImpl()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |