|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.REngine.REXP org.rosuda.REngine.REXPVector org.rosuda.REngine.REXPLogical
public class REXPLogical
REXPLogical represents a vector of logical values (TRUE, FALSE or NA). Unlike Java's boolean type R's logicals support NA values therefore either of isTRUE()
, isFALSE()
or isNA()
must be used to convert logicals to boolean values.
Field Summary | |
---|---|
static byte |
FALSE
|
static byte |
NA
NA boolean value as used in REXPLogical implementation. |
protected byte[] |
payload
|
static byte |
TRUE
|
Fields inherited from class org.rosuda.REngine.REXP |
---|
attr, maxDebugItems |
Constructor Summary | |
---|---|
REXPLogical(boolean load)
create logical vector of the length 1 with the given value as its first (and only) element |
|
REXPLogical(boolean[] load)
create logical vector with the payload specified by load |
|
REXPLogical(boolean[] load,
REXPList attr)
create integer vector with the payload specified by load and attributes attr |
|
REXPLogical(byte load)
create logical vector of the length 1 with the given value as its first (and only) element |
|
REXPLogical(byte[] load)
create logical vector with the payload specified by load |
|
REXPLogical(byte[] load,
REXPList attr)
create integer vector with the payload specified by load and attributes attr |
Method Summary | |
---|---|
byte[] |
asBytes()
returns the contents as an array of bytes (if supported by the represented object) |
double[] |
asDoubles()
returns the contents of this vector as doubles |
int[] |
asIntegers()
returns the contents as an array of integers (if supported by the represented object) |
java.lang.Object |
asNativeJavaObject()
attempt to represent the REXP by a native Java object and return it. |
java.lang.String[] |
asStrings()
returns the contents of this vector as strings |
boolean[] |
isFalse()
Deprecated. replaced by isTRUE() for consistency with R nomenclature. |
boolean[] |
isFALSE()
returns a boolean array of the same langth as the receiver with true for FALSE values and false for TRUE and NA values. |
boolean |
isLogical()
check whether the REXP object is a logical vector |
boolean[] |
isNA()
returns a boolean vector of the same length as this vector with true for NA values and false for any other values |
static boolean |
isNA(byte value)
|
boolean[] |
isTrue()
Deprecated. replaced by isTRUE() for consistency with R nomenclature. |
boolean[] |
isTRUE()
returns a boolean array of the same langth as the receiver with true for TRUE values and false for FALSE and NA values. |
int |
length()
returns the length of the vector (i.e. the number of elements) |
java.lang.String |
toDebugString()
returns representation that it useful for debugging (e.g. it includes attributes and may include vector values -- see REXP.maxDebugItems ) |
Methods inherited from class org.rosuda.REngine.REXPVector |
---|
isVector, toString |
Methods inherited from class org.rosuda.REngine.REXP |
---|
_attr, asDouble, asDoubleMatrix, asFactor, asInteger, asList, asString, createDataFrame, createDoubleMatrix, dim, getAttribute, hasAttribute, inherits, isComplex, isEnvironment, isExpression, isFactor, isInteger, isLanguage, isList, isNull, isNumeric, isPairList, isRaw, isRecursive, isReference, isString, isSymbol |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected byte[] payload
public static final byte NA
isNA(byte)
is provided for consistency.
public static final byte TRUE
public static final byte FALSE
Constructor Detail |
---|
public REXPLogical(boolean load)
public REXPLogical(byte load)
public REXPLogical(byte[] load)
load
public REXPLogical(boolean[] load)
load
public REXPLogical(byte[] load, REXPList attr)
load
and attributes attr
public REXPLogical(boolean[] load, REXPList attr)
load
and attributes attr
Method Detail |
---|
public static boolean isNA(byte value)
public int length()
REXPVector
length
in class REXPVector
public boolean isLogical()
REXP
REXP
object is a logical vector
isLogical
in class REXP
true
if the receiver is a logical vector, false
otherwisepublic java.lang.Object asNativeJavaObject()
REXP
int[1]
and not Integer
).
asNativeJavaObject
in class REXP
public int[] asIntegers()
REXP
asIntegers
in class REXP
public byte[] asBytes()
REXP
asBytes
in class REXP
public double[] asDoubles()
asDoubles
in class REXP
public java.lang.String[] asStrings()
asStrings
in class REXP
public boolean[] isNA()
REXPVector
true
for NA values and false
for any other values
isNA
in class REXPVector
true
for NA values and false
for any other valuespublic boolean[] isTRUE()
true
for TRUE
values and false
for FALSE
and NA
values.
public boolean[] isFALSE()
true
for FALSE
values and false
for TRUE
and NA
values.
public boolean[] isTrue()
isTRUE()
for consistency with R nomenclature.
true
for TRUE
values and false
for FALSE
and NA
values.
public boolean[] isFalse()
isTRUE()
for consistency with R nomenclature.
true
for FALSE
values and false
for TRUE
and NA
values.
public java.lang.String toDebugString()
REXP
REXP.maxDebugItems
)
toDebugString
in class REXPVector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |