|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.j2r.types.REXPAbstract
public abstract class REXPAbstract
Abstract class for REXP interface, in order to avoid duplicate code for attributes related methods.
| Field Summary | |
|---|---|
protected Map<String,Object> |
attributes
|
protected String |
dataInconsistencyText
|
protected REngine |
engine
|
protected String |
indexExceptionText
|
protected List<String> |
names
|
protected String |
noVariable
|
protected String |
variable
|
| Constructor Summary | |
|---|---|
REXPAbstract()
|
|
| Method Summary | |
|---|---|
protected void |
checkVariable()
Test that the variable name has been set so that the REXP can be sent to R. |
Object |
getAttribute(String attribute)
Method to get the value of an attribute (there is no synchronizing with R, use the update() method to synchronize data with R before using this method if you think data may have changed. |
Map<String,Object> |
getAttributes()
Method to get all the attributes of the data.frame (there is no synchronizing with R, use the update() method to synchronize data with R before using this method if you think data may have changed. |
REngine |
getEngine()
Method to get the engine used by the REXP |
String |
getName(int x)
Method to get the name of the ArrayList that is at this x index of the R data.frame. |
List<String> |
getNames()
Method to get the names of the ArrayLists of the R data.frame. |
String |
getVariable()
Method to get the variable name of the REXP |
void |
setAttribute(String attribute,
Boolean value)
|
void |
setAttribute(String attribute,
Double value)
|
void |
setAttribute(String attribute,
Integer value)
|
void |
setAttribute(String attribute,
Object value)
Method to set the value of an attribute (there is no synchronizing with R, use the commit() method to send data to R. |
void |
setAttribute(String attribute,
REXP value)
|
void |
setAttribute(String attribute,
String value)
|
void |
setAttributes(Map<String,Object> attributes)
Method to set all the attributes of the data.frame (there is no synchronizing with R, use the commit() method to send data to R. |
void |
setEngine(REngine engine)
Method to set the engine used by the REXP. |
void |
setName(int x,
String name)
Method to assign the name of the Object at the index x. |
void |
setNames(List<String> names)
Method to assign names of the complex REXP objects. |
void |
setVariable(String variable)
Method to set the R expression variable name |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.nuiton.j2r.types.REXP |
|---|
checkX, getFrom, toRString |
| Field Detail |
|---|
protected String variable
protected Map<String,Object> attributes
protected REngine engine
protected List<String> names
protected String indexExceptionText
protected String dataInconsistencyText
protected String noVariable
| Constructor Detail |
|---|
public REXPAbstract()
| Method Detail |
|---|
public void setAttributes(Map<String,Object> attributes)
throws RException
setAttributes in interface REXPattributes - a Map containing the attributes (key) and values (value)
(values are a R expression, String may be rounded with escaped
quote like : \"this is a R string\" ).
RException
public Map<String,Object> getAttributes()
throws RException
getAttributes in interface REXPRException
public Object getAttribute(String attribute)
throws RException
getAttribute in interface REXPattribute - name of the attribute
RException
public void setAttribute(String attribute,
Object value)
throws RException
setAttribute in interface REXPattribute - name of the attributevalue - the value to be set (this is a R expression, String may be
rounded with escaped quote like : \"this is a R string\" ).
RException
public void setAttribute(String attribute,
Double value)
throws RException
RException
public void setAttribute(String attribute,
Integer value)
throws RException
RException
public void setAttribute(String attribute,
Boolean value)
throws RException
RException
public void setAttribute(String attribute,
String value)
throws RException
RException
public void setAttribute(String attribute,
REXP value)
throws RException
RExceptionpublic String getVariable()
getVariable in interface REXP
public void setVariable(String variable)
throws RException
variable - the new variable name
RException - if something wrong happen while assigning the R expression to
the new variable in R.
public List<String> getNames()
throws RException
RException - if an error occurs while getting back the names from R.
IndexOutOfBoundsException - when the row.names size get from R is bigger than the local
data size.
public String getName(int x)
throws RException
x - index of the ArrayList (0 to n-1)
RException - if an error occurs while getting back the name from R.
IndexOutOfBoundsException - if the x index is out of bounds.
protected void checkVariable()
throws RException
RException - if the variable name have not been set.
public void setEngine(REngine engine)
throws RException
engine - Engine to be set
RException - If an error occur while assigning the list to the new
REngine.public REngine getEngine()
public void setNames(List<String> names)
throws RException
names - a ArrayList containing the names of the REXP.
RException - when the names list is longer than the REXP length.
public void setName(int x,
String name)
throws RException
x - index of the object (0 to n-1)name - Name of the object.
RException - if an error occur while in R
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||