|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.REngine.Rserve.protocol.REXPFactory
public class REXPFactory
representation of R-eXpressions in Java
Field Summary | |
---|---|
static int |
XT_ARRAY_BOOL
xpression type: RBool[] |
static int |
XT_ARRAY_BOOL_UA
internal use only! |
static int |
XT_ARRAY_CPLX
xpression type: Complex[] |
static int |
XT_ARRAY_DOUBLE
xpression type: double[] |
static int |
XT_ARRAY_INT
xpression type: int[] |
static int |
XT_ARRAY_STR
xpression type: String[] (currently not used, Vector is used instead) |
static int |
XT_BOOL
xpression type: RBool |
static int |
XT_CLOS
xpression type: closure (there is no java class for that type (yet?). |
static int |
XT_DOUBLE
xpression type: double |
static int |
XT_FACTOR
xpression type: RFactor; this XT is internally generated (ergo is does not come from Rsrv.h) to support RFactor class which is built from XT_ARRAY_INT |
static int |
XT_INT
xpression type: integer |
static int |
XT_LANG
xpression type: language construct (currently content is same as list) |
static int |
XT_LANG_NOTAG
xpression type: language list (w/o tags) |
static int |
XT_LANG_TAG
xpression type: language list (w tags) |
static int |
XT_LIST
xpression type: dotted-pair list (RList) |
static int |
XT_LIST_NOTAG
xpression type: dotted-pair list (w/o tags) |
static int |
XT_LIST_TAG
xpression type: dotted-pair list (w tags) |
static int |
XT_NULL
xpression type: NULL |
static int |
XT_RAW
xpression type: raw (byte[]) |
static int |
XT_S4
xpression type: S4 object |
static int |
XT_STR
xpression type: String |
static int |
XT_SYM
xpression type: symbol (content is symbol name: String) |
static int |
XT_SYMNAME
xpression type: symbol name |
static int |
XT_UNKNOWN
xpression type: unknown; no assumptions can be made about the content |
static int |
XT_VECTOR
xpression type: generic vector (RList) |
static int |
XT_VECTOR_EXP
xpression type: expression vector |
static int |
XT_VECTOR_STR
xpression type: string vector |
Constructor Summary | |
---|---|
REXPFactory()
|
|
REXPFactory(REXP r)
|
Method Summary | |
---|---|
REXPList |
getAttr()
|
int |
getBinaryLength()
Calculates the length of the binary representation of the REXP including all headers. |
int |
getBinaryRepresentation(byte[] buf,
int off)
Stores the REXP in its binary (ready-to-send) representation including header into a buffer and returns the index of the byte behind the REXP. |
REXP |
getREXP()
|
static int |
getStringBinaryRepresentation(byte[] buf,
int off,
java.lang.String s)
|
int |
parseREXP(byte[] buf,
int o)
parses byte buffer for binary representation of xpressions - read one xpression slot (descends recursively for aggregated xpressions such as lists, vectors etc.) |
static java.lang.String |
xtName(int xt)
returns human-readable name of the xpression type as string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int XT_NULL
public static final int XT_INT
public static final int XT_DOUBLE
public static final int XT_STR
public static final int XT_LANG
public static final int XT_SYM
public static final int XT_BOOL
public static final int XT_S4
public static final int XT_VECTOR
public static final int XT_LIST
public static final int XT_CLOS
public static final int XT_SYMNAME
public static final int XT_LIST_NOTAG
public static final int XT_LIST_TAG
public static final int XT_LANG_NOTAG
public static final int XT_LANG_TAG
public static final int XT_VECTOR_EXP
public static final int XT_VECTOR_STR
public static final int XT_ARRAY_INT
public static final int XT_ARRAY_DOUBLE
public static final int XT_ARRAY_STR
public static final int XT_ARRAY_BOOL_UA
public static final int XT_ARRAY_BOOL
public static final int XT_RAW
public static final int XT_ARRAY_CPLX
public static final int XT_UNKNOWN
public static final int XT_FACTOR
Constructor Detail |
---|
public REXPFactory()
public REXPFactory(REXP r) throws REXPMismatchException
REXPMismatchException
Method Detail |
---|
public REXP getREXP()
public REXPList getAttr()
public int parseREXP(byte[] buf, int o) throws REXPMismatchException
buf
- buffer containing the binary representationo
- offset in the buffer to start at
parseREXP(byte[], int)
if more than one expression is stored in the binary array.
REXPMismatchException
public int getBinaryLength() throws REXPMismatchException
getBinaryRepresentation(byte[], int)
.
Please note that currently only XT_[ARRAY_]INT, XT_[ARRAY_]DOUBLE and XT_[ARRAY_]STR are supported! All other types will return 4 which is the size of the header.
REXPMismatchException
public int getBinaryRepresentation(byte[] buf, int off) throws REXPMismatchException
Please note that currently only XT_[ARRAY_]INT, XT_[ARRAY_]DOUBLE and XT_[ARRAY_]STR are supported! All other types will be stored as SEXP of the length 0 without any contents.
buf
- buffer to store the REXP binary intooff
- offset of the first byte where to store the REXP
REXPMismatchException
public static int getStringBinaryRepresentation(byte[] buf, int off, java.lang.String s)
public static java.lang.String xtName(int xt)
xt
- xpression type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |