|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsi.sexp.Sexp
Abstract class to represent S-expressions. There are two subclasses to represent byte-string or list S-expressions.
SexpString
,
SexpList
,
Serialized FormField Summary | |
static char[] |
base64Digit
Provides a mapping from integers to the corresponing base-64 digit. |
static char[] |
hexDigit
Provides a mapping from integers to the corresponding hexadecimal digit. |
Constructor Summary | |
Sexp()
|
Method Summary | |
static int |
base64ToInt(byte b)
Converts a base-64 digit to its corresponding integer value. |
static byte[] |
base64ToOctet(byte a,
byte b,
byte c,
byte d)
Translates four base-64 digits into their corresponding three octet values. |
abstract int |
getCanonLen()
Calculates the length of the canonical representation of this S-expression. |
abstract byte[] |
getCanonRep()
Generates the canonical representation of this S-expression. |
(package private) abstract int |
getReadableLen()
|
static boolean |
isBase64Digit(int charToTest)
Tests if a character is a base 64 digit. |
static boolean |
isDecimalDigit(int charToTest)
Tests if a character is a decimal digit. |
static boolean |
isHexDigit(int charToTest)
Tests if a character is a hexadecimal digit. |
static boolean |
isTokenChar(int charToTest)
Tests if a character is a token character. |
static boolean |
isWhiteSpace(int charToTest)
Tests if a character is whitespace. |
static Sexp |
parse(java.io.PushbackInputStream input)
Parses an S-expression out of the input stream. |
abstract java.lang.String |
toReadableString(int offset,
int width,
int last)
Returns a readable string representation of this S-expression. |
java.lang.String |
toString()
Returns a string representation of this S-expression. |
static java.lang.String |
toString(byte[] b)
Converts an array of bytes to a String. |
java.lang.String |
toVerbatimString()
Returns a string representation of the canonical form of this S-expression. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 charToTest)
charToTest
- the character to be tested
true
if the character is whitespace,
false
otherwisepublic static final boolean isDecimalDigit(int charToTest)
charToTest
- the character to be tested
true
if the character is a digit between 0
and 9 inclusive, false
otherwisepublic static final boolean isHexDigit(int charToTest)
charToTest
- 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 charToTest)
charToTest
- 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 charToTest)
charToTest
- the character to be tested.
true
if the character is a legal token character
for an S-expression, false
otherwisepublic static final int base64ToInt(byte b)
b
- the byte representing the base-64 digit.
public static final byte[] base64ToOctet(byte a, byte b, byte c, byte d) throws SexpException
SexpException
- if the bytes are not valid base-64
characters or do not correctly encode one, two, or three bytes.public static Sexp parse(java.io.PushbackInputStream input) throws SexpException
input
- an input stream conaining an S-expression.
SexpException
- if there was a problem in the parse.public static java.lang.String toString(byte[] b)
b
- the byte array to be decoded
public abstract int getCanonLen()
public abstract byte[] getCanonRep()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract java.lang.String toReadableString(int offset, int width, int last)
offset
- the number of spaces that should appear
before every line of the string.width
- the total width that the string should take up
in characters.last
- the number of spaces that should be left
at the end of every line (for possible closing parens).
abstract int getReadableLen()
public java.lang.String toVerbatimString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |