|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsi.sexp.Sexp | +--sdsi.sexp.SexpString
This class represents simple S-Expressions. These are S-Expession which are just byte-strings.
Sexp
,
Serialized FormField Summary | |
(package private) SimpleString |
content
|
(package private) SimpleString |
display
|
Fields inherited from class sdsi.sexp.Sexp |
base64Digit, hexDigit |
Constructor Summary | |
SexpString(byte[] contents)
Create a new SexpString with no display-hint and content equal to the byte array given. |
|
SexpString(java.io.PushbackInputStream p)
Create a new SexpString by parsing an S-Expression out of the input stream. |
|
SexpString(java.lang.String contents)
Create a new SexpString with no display-hint and content equal to the String given. |
|
SexpString(java.lang.String display_type,
byte[] contents)
Create a new SexpString with the given display-hint and content. |
|
SexpString(java.lang.String display_type,
java.lang.String contents)
Create a new SexpString with the given display-hint and content. |
Method Summary | |
byte[] |
bytesContent()
Returns the bytes of this SexpString, not including the display hint. |
int |
compareTo(SexpString other)
Compares the string representation of two SexpStrings lexicographically. |
boolean |
equals(SexpString other)
Tests if two SexpStrings are equal. |
int |
getCanonLen()
Calculates the length of the canonical representation of this S-expression. |
byte[] |
getCanonRep()
Generates the canonical representation of this S-expression. |
(package private) int |
getReadableLen()
|
boolean |
startsWith(SexpString other)
Tests if the string representation of this SexpString starts with the string representation of another SexpString. |
java.lang.String |
stringContent()
Returns the SexpString as a String, without the display hint. |
java.lang.String |
toReadableString(int offset,
int width,
int last)
Returns a readable string representation of this S-expression. |
Methods inherited from class sdsi.sexp.Sexp |
base64ToInt, base64ToOctet, isBase64Digit, isDecimalDigit, isHexDigit, isTokenChar, isWhiteSpace, parse, toString, toString, toVerbatimString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
SimpleString display
SimpleString content
Constructor Detail |
public SexpString(java.lang.String contents)
contents
- the contents of the SexpString.public SexpString(java.lang.String display_type, java.lang.String contents)
display_type
- the value of the display hint of the S-Expression.contents
- the content of the S-Expression.public SexpString(byte[] contents)
contents
- the contents of the SexpString.public SexpString(java.lang.String display_type, byte[] contents)
display_type
- the value of the display hint of the S-Expression.contents
- the content of the S-Expression.public SexpString(java.io.PushbackInputStream p) throws SexpException
p
- the PushbackInputStream which contains the bytes of an S-Expression.
SexpException
- if there was a problem parsing the S-ExpressionMethod Detail |
public java.lang.String stringContent()
public byte[] bytesContent()
public java.lang.String toReadableString(int offset, int width, int last)
Sexp
toReadableString
in class Sexp
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).
int getReadableLen()
getReadableLen
in class Sexp
public int getCanonLen()
Sexp
getCanonLen
in class Sexp
public byte[] getCanonRep()
Sexp
getCanonRep
in class Sexp
public int compareTo(SexpString other) throws SexpException
other
- the SexpString to be compared.
SexpException
- if the display types are not equal.public boolean startsWith(SexpString other)
other
- the SexpString to serve as a prefix
true
if the character sequence represented by the argument is a prefix of
the character sequence represented by this SexpString; false
otherwise.public boolean equals(SexpString other)
other
- the SexpString to test equality with
true
if both SexpStrings have the same display type and content,
false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |