|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.JRI.RList
public class RList
implementation of R-lists
This is rather preliminary and may change in future since it's not really proper.
The point is that the parser tries to interpret lists to be of the form entry=value,
where entry is stored in the "head" part, and value is stored in the "body" part.
Then using at(String)
it is possible to fetch "body" for a specific "head".
The terminology used is partly from hash fields - "keys" are the elements in "head"
and values are in "body" (see keys
).
On the other hand, R uses lists to store complex internal structures, which are not parsed according to the structure - in that case "head" and "body" have to be evaluated separately according to their meaning in that context.
Field Summary | |
---|---|
REXP |
body
xpressions containing head, body and tag. |
REXP |
head
xpressions containing head, body and tag. |
REXP |
tag
xpressions containing head, body and tag. |
Constructor Summary | |
---|---|
RList()
constructs an empty list |
|
RList(REXP h,
REXP b)
constructs an initialized list |
|
RList(REXP h,
REXP t,
REXP b)
constructs an initialized list |
|
RList(RVector v)
fake constructor to keep compatibility with Rserve (for now, will be gone soon) |
Method Summary | |
---|---|
REXP |
at(int i)
get element at the specified position |
REXP |
at(java.lang.String v)
get xpression given a key |
REXP |
getBody()
get body xpression (CDR) |
REXP |
getHead()
get head xpression (CAR) |
REXP |
getTag()
get tag xpression |
java.lang.String[] |
keys()
returns all keys of the list |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public REXP head
public REXP body
public REXP tag
Constructor Detail |
---|
public RList()
public RList(RVector v)
public RList(REXP h, REXP b)
h
- head xpressionb
- body xpressionpublic RList(REXP h, REXP t, REXP b)
h
- head xpression (CAR)t
- tag xpression (TAG)b
- body/tail xpression (CDR)Method Detail |
---|
public REXP getHead()
public REXP getBody()
public REXP getTag()
public REXP at(java.lang.String v)
v
- key
null
if list is not standartized or key not foundpublic REXP at(int i)
i
- index
null
if list is not standartized or
if index out of boundspublic java.lang.String[] keys()
null
if list is not standartized
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |