forked from s-u/REngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREXPJavaReference.java
26 lines (20 loc) · 930 Bytes
/
REXPJavaReference.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.rosuda.REngine;
/** REXPJavaReference is a reference to a Java object that has been resolved from is R wrapper. Note that not all engines support references. */
public class REXPJavaReference extends REXP {
/** the referenced Java object */
Object object;
/** creates a new Java reference R object
* @param o Java object referenced by the REXP */
public REXPJavaReference(Object o) { super(); this.object = o; }
/** creates a new Java reference R object
* @param o Java object referenced by the REXP
* @param attr attributes (of the R wrapper) */
public REXPJavaReference(Object o, REXPList attr) { super(attr); this.object = o; }
/** returns the Java object referenced by this REXP
* @return Java object */
public Object getObject() { return object; }
public Object asNativeJavaObject() { return object; }
public String toString() {
return super.toString() + "[" + object + "]";
}
}