|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectneustore.base.StringData
public class StringData
A class that stores a variable-length String. Note that to write a StringData to disk, the occupied size is four bytes larger than the String size, for we also store the size of the String.
Field Summary | |
---|---|
protected int |
maxStringLength
maximum length of a String. |
java.lang.String |
string
the stored String |
Constructor Summary | |
---|---|
StringData(int _maxStringLength,
java.lang.String _string)
The constructor takes as input the max length of a string. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates a new copy of the object. |
int |
maxSize()
Returns the maximum number of bytes this type of object may occupy. |
void |
read(java.io.DataInputStream in)
Reads the object from an input stream. |
int |
size()
|
void |
write(java.io.DataOutputStream out)
Writes the object to an output stream. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int maxStringLength
public java.lang.String string
Constructor Detail |
---|
public StringData(int _maxStringLength, java.lang.String _string)
_maxStringLength
- max length of a stringMethod Detail |
---|
public java.lang.Object clone()
Data
clone
in interface Data
clone
in class java.lang.Object
public int size()
size
in interface Data
public int maxSize()
Data
maxSize
in interface Data
public void read(java.io.DataInputStream in) throws java.io.IOException
Data
read
in interface Data
in
- input stream
java.io.IOException
public void write(java.io.DataOutputStream out) throws java.io.IOException
Data
write
in interface Data
out
- output stream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |