org.rosuda.REngine
Class REXPNull

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

public class REXPNull
extends REXP

represents a NULL object in R.

Note: there is a slight asymmetry - in R NULL is represented by a zero-length pairlist. For this reason REXPNull returns true for isList() and asList() will return an empty list. Nonetheless REXPList of the length 0 will NOT return true in isNull() (currently), becasue it is considered a different object in Java. These nuances are still subject to change, because it's not clear how it should be treated. At any rate use REXPNull instead of empty REXPList if NULL is the intended value.


Field Summary
 
Fields inherited from class org.rosuda.REngine.REXP
attr, maxDebugItems
 
Constructor Summary
REXPNull()
           
REXPNull(REXPList attr)
           
 
Method Summary
 RList asList()
          returns the contents as a (named) list (if supported by the represented object)
 java.lang.Object asNativeJavaObject()
          attempt to represent the REXP by a native Java object and return it.
 boolean isList()
          check whether the REXP object is a list (either generic vector or a pairlist - i.e.
 boolean isNull()
          check whether the REXP object is NULL
 
Methods inherited from class org.rosuda.REngine.REXP
_attr, asBytes, asDouble, asDoubleMatrix, asDoubles, asFactor, asInteger, asIntegers, asString, asStrings, createDataFrame, createDoubleMatrix, dim, getAttribute, hasAttribute, inherits, isComplex, isEnvironment, isExpression, isFactor, isInteger, isLanguage, isLogical, isNA, 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

REXPNull

public REXPNull()

REXPNull

public REXPNull(REXPList attr)
Method Detail

isNull

public boolean isNull()
Description copied from class: REXP
check whether the REXP object is NULL

Overrides:
isNull in class REXP
Returns:
true if the receiver is NULL, false otherwise

isList

public boolean isList()
Description copied from class: REXP
check whether the REXP object is a list (either generic vector or a pairlist - i.e. REXP.asList() will succeed)

Overrides:
isList in class REXP
Returns:
true if the receiver is a generic vector or a pair-list, false otherwise

asList

public RList asList()
Description copied from class: REXP
returns the contents as a (named) list (if supported by the represented object)

Overrides:
asList in class REXP

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