org.rosuda.REngine
Class REXPJavaReference

java.lang.Object
  extended by org.rosuda.REngine.REXP
      extended by org.rosuda.REngine.REXPJavaReference

public class REXPJavaReference
extends REXP

REXPJavaReference is a reference to a Java object that has been resolved from is R wrapper. Note that not all engines support references.


Field Summary
 
Fields inherited from class org.rosuda.REngine.REXP
attr, maxDebugItems
 
Constructor Summary
REXPJavaReference(java.lang.Object o)
          creates a new Java reference R object
REXPJavaReference(java.lang.Object o, REXPList attr)
          creates a new Java reference R object
 
Method Summary
 java.lang.Object asNativeJavaObject()
          attempt to represent the REXP by a native Java object and return it.
 java.lang.Object getObject()
          returns the Java object referenced by this REXP
 java.lang.String toString()
          returns a string description of the object
 
Methods inherited from class org.rosuda.REngine.REXP
_attr, asBytes, asDouble, asDoubleMatrix, asDoubles, asFactor, asInteger, asIntegers, asList, asString, asStrings, createDataFrame, createDoubleMatrix, dim, getAttribute, hasAttribute, inherits, isComplex, isEnvironment, isExpression, isFactor, isInteger, isLanguage, isList, isLogical, isNA, isNull, isNumeric, isPairList, isRaw, isRecursive, isReference, isString, isSymbol, isVector, length, toDebugString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

REXPJavaReference

public REXPJavaReference(java.lang.Object o)
creates a new Java reference R object

Parameters:
o - Java object referenced by the REXP

REXPJavaReference

public REXPJavaReference(java.lang.Object o,
                         REXPList attr)
creates a new Java reference R object

Parameters:
o - Java object referenced by the REXP
attr - attributes (of the R wrapper)
Method Detail

getObject

public java.lang.Object getObject()
returns the Java object referenced by this REXP

Returns:
Java object

asNativeJavaObject

public java.lang.Object asNativeJavaObject()
Description copied from class: REXP
attempt to represent the REXP by a native Java object and return it. Note that this may lead to loss of information (e.g., factors may be returned as a string array) and attributes are ignored. Not all R types can be converted to native Java objects. Also note that R has no concept of scalars, so vectors of length 1 will always be returned as an arrays (i.e., int[1] and not Integer).

Overrides:
asNativeJavaObject in class REXP

toString

public java.lang.String toString()
Description copied from class: REXP
returns a string description of the object

Overrides:
toString in class REXP
Returns:
string describing the object - it can be of an arbitrary form and used only for debugging (do not confuse with REXP.asString() for accessing string REXPs)