|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.JRclient.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 and body. |
REXP |
head
xpressions containing head and body. |
REXP |
tag
xpressions containing head and body. |
Constructor Summary | |
RList()
constructs an empty list |
|
RList(REXP h,
REXP b)
constructs an initialized list |
Method Summary | |
REXP |
at(int i)
get element at the specified position |
REXP |
at(String v)
get xpression given a key |
REXP |
getBody()
get body xpression (CDR) |
REXP |
getHead()
get head xpression (CAR) |
REXP |
getTag()
get tag xpression |
String[] |
keys()
returns all keys of the list |
Methods inherited from class java.lang.Object |
equals, 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(REXP h, REXP b)
h
- head xpressionb
- body xpressionMethod Detail |
public REXP getHead()
public REXP getBody()
public REXP getTag()
public REXP at(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 String[] keys()
null
if list is not standartized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |