ec.util
Class DecodeReturn
- java.lang.Object
-
- ec.util.DecodeReturn
-
public class DecodeReturn extends java.lang.ObjectDecodeReturn 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
Fields Modifier and Type Field and Description doubledStores floats, doublesjava.lang.StringdataThe DecodeReturn string that's read from.longlStores booleans (0=false), bytes, chars, shorts, ints, longsintlineNumberThe Line number, if it has been posted.intposThe DecodeReturn new position in the string.java.lang.StringsStores strings, error messagesstatic byteT_BOOLEANstatic byteT_BYTEstatic byteT_CHARstatic byteT_CHARACTERSame as T_CHARstatic byteT_DOUBLEstatic byteT_ERRORThe actual error is stored in the String slotstatic byteT_FLOATstatic byteT_INTstatic byteT_INTEGERSame as T_INTstatic byteT_LONGstatic byteT_SHORTstatic byteT_STRINGbytetypeThe DecodeReturn type
-
Constructor Summary
Constructors Constructor and Description DecodeReturn(java.lang.String _data)Use this to make a new DecodeReturn starting at position 0DecodeReturn(java.lang.String _data, int _pos)Use this to make a new DecodeReturn starting at some position
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DecodeReturnreset(java.lang.String _data)Use this to reuse your DecodeReturn for another stringDecodeReturnreset(java.lang.String _data, int _pos)Use this to reuse your DecodeReturn for another stringDecodeReturnscanAt(int _pos)Sets the DecodeReturn to begin scanning at _pos, which should be valid.
-
-
-
Field Detail
-
T_ERROR
public static final byte T_ERROR
The actual error is stored in the String slot- See Also:
- Constant Field Values
-
T_BOOLEAN
public static final byte T_BOOLEAN
- See Also:
- Constant Field Values
-
T_BYTE
public static final byte T_BYTE
- See Also:
- Constant Field Values
-
T_CHAR
public static final byte T_CHAR
- See Also:
- Constant Field Values
-
T_CHARACTER
public static final byte T_CHARACTER
Same as T_CHAR- See Also:
- Constant Field Values
-
T_SHORT
public static final byte T_SHORT
- See Also:
- Constant Field Values
-
T_INT
public static final byte T_INT
- See Also:
- Constant Field Values
-
T_INTEGER
public static final byte T_INTEGER
Same as T_INT- See Also:
- Constant Field Values
-
T_LONG
public static final byte T_LONG
- See Also:
- Constant Field Values
-
T_FLOAT
public static final byte T_FLOAT
- See Also:
- Constant Field Values
-
T_DOUBLE
public static final byte T_DOUBLE
- See Also:
- Constant Field Values
-
T_STRING
public static final byte T_STRING
- See Also:
- Constant Field Values
-
lineNumber
public int lineNumber
The Line number, if it has been posted.
-
type
public byte type
The DecodeReturn type
-
data
public java.lang.String data
The DecodeReturn string that's read from.
-
pos
public int pos
The DecodeReturn new position in the string. Set this yourself. New values get set here automatically.
-
l
public long l
Stores booleans (0=false), bytes, chars, shorts, ints, longs
-
d
public double d
Stores floats, doubles
-
s
public java.lang.String s
Stores strings, error messages
-
-
Constructor Detail
-
DecodeReturn
public DecodeReturn(java.lang.String _data)
Use this to make a new DecodeReturn starting at position 0
-
DecodeReturn
public DecodeReturn(java.lang.String _data, int _pos)Use this to make a new DecodeReturn starting at some position
-
-
Method Detail
-
scanAt
public DecodeReturn scanAt(int _pos)
Sets the DecodeReturn to begin scanning at _pos, which should be valid.
-
reset
public DecodeReturn reset(java.lang.String _data)
Use this to reuse your DecodeReturn for another string
-
reset
public DecodeReturn reset(java.lang.String _data, int _pos)
Use this to reuse your DecodeReturn for another string
-
-
DMelt 3.0 © DataMelt by jWork.ORG