|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsi.sexp.Sexp | +--sdsi.sexp.SexpList
This class is used to represent S-Expressions which are not simple byte-strings. That is, they are lists of other S-Expressions.
Sexp
,
Serialized FormField Summary | |
(package private) java.util.Vector |
elements
|
Fields inherited from class sdsi.sexp.Sexp |
base64Digit, hexDigit |
Constructor Summary | |
SexpList(java.io.PushbackInputStream p)
Create a new SexpList by parsing an S-Expression out of the input stream. |
|
SexpList(Sexp[] expressions)
Create a new SexpList containing all the Sexp's given in the array. |
Method Summary | |
boolean |
allElementsStrings()
Tests whether all the elements in this SexpList are simple strings or if there is a list. |
Sexp[] |
arrayOfElements()
Puts all the Sexp's in the list into an array of the correct size and returns it |
Sexp |
elementAt(int index)
Returns the Sexp located at the given index. |
java.util.Enumeration |
elements()
Returns an enumeration of the elements in the SexpList. |
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()
|
java.lang.String |
getType()
Returns a string representing the first elemenent in the list. |
int |
size()
Returns the number of elements in this list |
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 |
java.util.Vector elements
Constructor Detail |
public SexpList(Sexp[] expressions)
expressions
- the array of expressions to be contained in the
SexpListpublic SexpList(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 getType()
public int getCanonLen()
Sexp
getCanonLen
in class Sexp
public byte[] getCanonRep()
Sexp
getCanonRep
in class Sexp
int getReadableLen()
getReadableLen
in class Sexp
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).
public Sexp elementAt(int index)
index
- the index of the Sexp to return
public int size()
public java.util.Enumeration elements()
public Sexp[] arrayOfElements()
public boolean allElementsStrings()
false
if there is a SexpList inside this
SexpList, true
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |