org.rosuda.REngine
Class REXPEnvironment

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

public class REXPEnvironment
extends REXP

REXPEnvironment represents an environment in R. Very much like REXPReference this is a proxy object to the actual object on the R side. It provides methods for accessing the content of the environment. The actual implementation may vary by the back-end used and not all engines support environments. Check org.rosuda.REngine.REngine.supportsEnvironments() for the given engine. Environments are specific for a given engine, they cannot be passed across engines.


Field Summary
 
Fields inherited from class org.rosuda.REngine.REXP
attr, maxDebugItems
 
Constructor Summary
REXPEnvironment(REngine eng, java.lang.Object handle)
          create a new environemnt reference - this constructor should never be used directly, use REngine.newEnvironment() instead.
 
Method Summary
 void assign(java.lang.String name, REXP value)
          assigns a value to a given symbol name
 REXP get(java.lang.String name)
          get a value from this environment - equavalent to get(name, true).
 REXP get(java.lang.String name, boolean resolve)
          get a value from this environment
 java.lang.Object getHandle()
          returns the handle used to identify this environemnt in the engine - for internal use by engine implementations only
 boolean isEnvironment()
          check whether the REXP object is an environment
 REXPEnvironment parent()
          returns the parent environment.
 REXP parent(boolean resolve)
          returns the parent environment or a reference to it
 
Methods inherited from class org.rosuda.REngine.REXP
_attr, asBytes, asDouble, asDoubleMatrix, asDoubles, asFactor, asInteger, asIntegers, asList, asNativeJavaObject, asString, asStrings, createDataFrame, createDoubleMatrix, dim, getAttribute, hasAttribute, inherits, isComplex, isExpression, isFactor, isInteger, isLanguage, isList, isLogical, isNA, isNull, isNumeric, isPairList, isRaw, isRecursive, isReference, isString, isSymbol, isVector, length, toDebugString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

REXPEnvironment

public REXPEnvironment(REngine eng,
                       java.lang.Object handle)
create a new environemnt reference - this constructor should never be used directly, use REngine.newEnvironment() instead.

Parameters:
eng - engine responsible for this environment
handle - handle used by the engine to identify this environment
Method Detail

isEnvironment

public boolean isEnvironment()
Description copied from class: REXP
check whether the REXP object is an environment

Overrides:
isEnvironment in class REXP
Returns:
true if the receiver is an environment, false otherwise

getHandle

public java.lang.Object getHandle()
returns the handle used to identify this environemnt in the engine - for internal use by engine implementations only

Returns:
handle of this environment

get

public REXP get(java.lang.String name,
                boolean resolve)
         throws REngineException
get a value from this environment

Parameters:
name - name of the value
resolve - if false returns a reference to the object, if false the reference is resolved
Returns:
value corresponding to the symbol name or possibly null if the value is unbound (the latter is currently engine-specific)
Throws:
REngineException

get

public REXP get(java.lang.String name)
         throws REngineException
get a value from this environment - equavalent to get(name, true).

Parameters:
name - name of the value
Returns:
value (see get(String,boolean))
Throws:
REngineException

assign

public void assign(java.lang.String name,
                   REXP value)
            throws REngineException,
                   REXPMismatchException
assigns a value to a given symbol name

Parameters:
name - symbol name
value - value
Throws:
REngineException
REXPMismatchException

parent

public REXP parent(boolean resolve)
            throws REngineException
returns the parent environment or a reference to it

Parameters:
resolve - if true returns the environemnt, otherwise a reference.
Returns:
parent environemnt (or a reference to it)
Throws:
REngineException

parent

public REXPEnvironment parent()
                       throws REngineException
returns the parent environment. This is equivalent to parent(true).

Returns:
parent environemnt
Throws:
REngineException