|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--sexp.SimpleString
This class represents the lowest-level S-Expression object. TODO: Complete JavaDoc documentation of public methods. Note, {presentation,display}-hint handling is in Sexp.
SExpression,
Sexp,
SList| Field Summary | |
private static String |
__me
|
String |
byte_encoding
Encoding used when converting from a byte array to whatever. |
private static boolean |
debug
|
protected static String |
default_encoding
|
private int |
length
|
private byte[] |
string
|
String |
string_encoding
Encoding used when converting from a String to whatever. |
| Constructor Summary | |
SimpleString()
Creates and initializes new SimpleString. |
|
SimpleString(byte[] data)
Constructor accepting "raw" data (in a byte array). |
|
SimpleString(String data)
Constructor accepting an initial string. |
|
| Method Summary | |
int |
allocated()
Get length of allocated storage space. |
void |
append(byte c)
Append a byte to this object. |
void |
append(byte[] ba)
Append a byte-array to this object. |
void |
append(String str)
Append a String to this object. |
void |
append(String str,
String enc)
Append a String to this object, using the specified encoding. |
Object |
clone()
Duplicate this object. |
int |
compareTo(byte[] ba)
Compare this object with the given byte-array. |
int |
compareTo(byte[] ba,
int len)
Compare a number of bytes of this object with the given byte-array. |
int |
compareTo(SimpleString sim)
Compare this object with some other SimpleString object. |
int |
compareTo(SimpleString sim,
int len)
Compare a number of bytes of this object with some other SimpleString object. |
int |
compareTo(String str)
Compare this object with the given String. |
int |
compareTo(String str,
int len)
Compare a number of bytes of this object with the given String. |
int |
compareTo(String str,
int len,
String enc)
Compare a number of bytes of this object with the given String, using the given encoding. |
int |
compareTo(String str,
String enc)
Compare this object with the given String, using the given encoding. |
protected void |
debugDump()
|
boolean |
equals(byte[] that)
See if this SimpleString is equal to the given Object. |
boolean |
equals(String that)
See if this SimpleString is equal to the given Object. |
void |
finalize()
|
void |
free()
Destroy and free the resouces associated with this object. |
byte[] |
getByteArray()
Get access to the raw byte array. |
void |
grow()
Increase size of object. |
void |
grow(int growth)
Increase size of object. |
boolean |
isList()
|
int |
length()
Get length of stored data. |
String |
toString()
Convert this object to a string using the default byte encoding (ISO8859-1). |
String |
toString(String enc)
Convert this object to a string using the given byte encoding. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final String __me
protected static String default_encoding
public String string_encoding
public String byte_encoding
private static boolean debug
private byte[] string
private int length
| Constructor Detail |
public SimpleString()
public SimpleString(byte[] data)
throws SexpException
public SimpleString(String data)
SimpleString#getRaw()| Method Detail |
public void finalize()
throws Throwable
public void grow(int growth)
growth - number of bytes object should be increased withpublic void grow()
public int length()
public int allocated()
public byte[] getByteArray()
public void append(byte c)
c - byte to be appendedpublic void append(byte[] ba)
ba - byte-array to be appendedpublic void append(String str)
str - String to be appended
public void append(String str,
String enc)
throws UnsupportedEncodingException
str - String to be appendedenc - encoding to use
public Object clone()
throws CloneNotSupportedException
public void free()
public boolean isList()
public String toString()
public String toString(String enc)
throws UnsupportedEncodingException
enc - Encoding to usepublic boolean equals(String that)
that - String to compare this object with.compareTo(java.lang.String)public boolean equals(byte[] that)
that - String to compare this object with.compareTo(byte[])
public int compareTo(byte[] ba,
int len)
ba - byte-array to compare this object with.len - number of bytes to compare.public int compareTo(byte[] ba)
ba - byte-array to compare this object with.
public int compareTo(SimpleString sim,
int len)
sim - SimpleString to compare this object with.len - number of bytes to compare.public int compareTo(SimpleString sim)
sim - SimpleString to compare this object with.
public int compareTo(String str,
int len,
String enc)
throws UnsupportedEncodingException
str - String to compare this object with.len - number of bytes to compare.enc - encoding to use
public int compareTo(String str,
int len)
str - String to compare this object with.len - number of bytes to compare.
public int compareTo(String str,
String enc)
throws UnsupportedEncodingException
str - String to compare this object with.enc - encoding to usepublic int compareTo(String str)
str - String to compare this object with.protected void debugDump()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||