
carosellini.rJava.REngine.0.9-7.source-code.REXPNull Maven / Gradle / Ivy
Show all versions of REngine Show documentation
package org.rosuda.REngine;
/** 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 {@link #isList()} and {@link #asList()} will return an empty list. Nonetheless REXPList
of the length 0 will NOT return true
in {@link #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.
*/
public class REXPNull extends REXP {
public REXPNull() { super(); }
public REXPNull(REXPList attr) { super(attr); }
public boolean isNull() { return true; }
public boolean isList() { return true; } // NULL is a list
public RList asList() { return new RList(); }
public Object asNativeJavaObject() { return null; }
}