org.rosuda.REngine
Class REXPMismatchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.rosuda.REngine.REXPMismatchException
- All Implemented Interfaces:
- java.io.Serializable
public class REXPMismatchException
- extends java.lang.Exception
This exception is thrown whenever the operation requested is not supported by the given R object type, e.g. using asStrings on an S4 object. Most REXP
methods throw this exception. Previous R/Java interfaces were silently returning null
in those cases, but using exceptions helps to write more robust code.
- See Also:
- Serialized Form
Method Summary |
java.lang.String |
getAccess()
get the assumed access type that was violated by the sender. |
REXP |
getSender()
retrieve the exception sender/origin |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
REXPMismatchException
public REXPMismatchException(REXP sender,
java.lang.String access)
- primary constructor. The exception message will be formed as "attempt to access <REXP-class> as <access-string>"
- Parameters:
sender
- R object that triggered this exception (cannot be null
!)access
- assumed type of the access that was requested. It should be a simple name of the assumed type (e.g. "vector"). The type name can be based on R semantics beyond basic types reflected by REXP classes. In cases where certain assertions were not satisfied, the string should be of the form "type (assertion)" (e.g. "data frame (must have dim>0)").
getSender
public REXP getSender()
- retrieve the exception sender/origin
- Returns:
- REXP object that triggered the exception
getAccess
public java.lang.String getAccess()
- get the assumed access type that was violated by the sender.
- Returns:
- string describing the access type. See
REXPMismatchException(org.rosuda.REngine.REXP, java.lang.String)
for details.