|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ec.util.DecodeReturn
DecodeReturn is used by Code to provide varied information returned when decoding. You start the decoding process by initializing the DecodeReturn on a string you want to decode items out of. Then you repeatedly pass the DecodeReturn to Code.decode(...), and each time the DecodeReturn will contain information about the next token, namely, its type, the data of the token (depending on type, this can be in one of three slots, d, l, or s), and the start position for reading the next token.
In case of an error, type is set to DecodeReturn.T_ERROR, pos is kept at the token where the error occured, and s is set to an error message.
Field Summary | |
double |
d
Stores floats, doubles |
java.lang.String |
data
The DecodeReturn string that's read from. |
long |
l
Stores booleans (0=false), bytes, chars, shorts, ints, longs |
int |
pos
The DecodeReturn new position in the string. |
java.lang.String |
s
Stores strings, error messages |
static byte |
T_BOOLEAN
|
static byte |
T_BYTE
|
static byte |
T_CHAR
|
static byte |
T_DOUBLE
|
static byte |
T_ERROR
The actual error is stored in the String slot |
static byte |
T_FLOAT
|
static byte |
T_INT
|
static byte |
T_LONG
|
static byte |
T_SHORT
|
static byte |
T_STRING
|
byte |
type
The DecodeReturn type |
Constructor Summary | |
DecodeReturn(java.lang.String _data)
Use this to make a new DecodeReturn starting at position 0 |
|
DecodeReturn(java.lang.String _data,
int _pos)
Use this to make a new DecodeReturn starting at some position |
Method Summary | |
DecodeReturn |
reset(java.lang.String _data)
Use this to reuse your DecodeReturn for another string |
DecodeReturn |
reset(java.lang.String _data,
int _pos)
Use this to reuse your DecodeReturn for another string |
DecodeReturn |
scanAt(int _pos)
Sets the DecodeReturn to begin scanning at _pos, which should be valid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte T_ERROR
public static final byte T_BOOLEAN
public static final byte T_BYTE
public static final byte T_CHAR
public static final byte T_SHORT
public static final byte T_INT
public static final byte T_LONG
public static final byte T_FLOAT
public static final byte T_DOUBLE
public static final byte T_STRING
public byte type
public java.lang.String data
public int pos
public long l
public double d
public java.lang.String s
Constructor Detail |
public DecodeReturn(java.lang.String _data)
public DecodeReturn(java.lang.String _data, int _pos)
Method Detail |
public final DecodeReturn scanAt(int _pos)
public DecodeReturn reset(java.lang.String _data)
public DecodeReturn reset(java.lang.String _data, int _pos)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |