org.rosuda.REngine
Class REXPRaw

java.lang.Object
  extended by org.rosuda.REngine.REXP
      extended by org.rosuda.REngine.REXPVector
          extended by org.rosuda.REngine.REXPRaw

public class REXPRaw
extends REXPVector

REXPRaw represents a raw vector in R - essentially a sequence of bytes.


Field Summary
 
Fields inherited from class org.rosuda.REngine.REXP
attr, maxDebugItems
 
Constructor Summary
REXPRaw(byte[] load)
          create a new raw vector with the specified payload
REXPRaw(byte[] load, REXPList attr)
          create a new raw vector with the specified payload and attributes
 
Method Summary
 byte[] asBytes()
          returns the contents as an array of bytes (if supported by the represented object)
 java.lang.Object asNativeJavaObject()
          attempt to represent the REXP by a native Java object and return it.
 boolean isRaw()
          check whether the REXP object is a raw vector
 int length()
          returns the length of the vector (i.e. the number of elements)
 
Methods inherited from class org.rosuda.REngine.REXPVector
isNA, isVector, toDebugString, toString
 
Methods inherited from class org.rosuda.REngine.REXP
_attr, asDouble, asDoubleMatrix, asDoubles, asFactor, asInteger, asIntegers, asList, asString, asStrings, createDataFrame, createDoubleMatrix, dim, getAttribute, hasAttribute, inherits, isComplex, isEnvironment, isExpression, isFactor, isInteger, isLanguage, isList, isLogical, isNull, isNumeric, isPairList, isRecursive, isReference, isString, isSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

REXPRaw

public REXPRaw(byte[] load)
create a new raw vector with the specified payload

Parameters:
load - payload of the raw vector

REXPRaw

public REXPRaw(byte[] load,
               REXPList attr)
create a new raw vector with the specified payload and attributes

Parameters:
load - payload of the raw vector
attr - attributes for the resulting R object
Method Detail

length

public int length()
Description copied from class: REXPVector
returns the length of the vector (i.e. the number of elements)

Specified by:
length in class REXPVector
Returns:
length of the vector

isRaw

public boolean isRaw()
Description copied from class: REXP
check whether the REXP object is a raw vector

Overrides:
isRaw in class REXP
Returns:
true if the receiver is a raw vector, false otherwise

asBytes

public byte[] asBytes()
Description copied from class: REXP
returns the contents as an array of bytes (if supported by the represented object)

Overrides:
asBytes 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