org.rosuda.REngine
Class REXPString

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

public class REXPString
extends REXPVector

REXPString represents a character vector in R.


Field Summary
 
Fields inherited from class org.rosuda.REngine.REXP
attr, maxDebugItems
 
Constructor Summary
REXPString(java.lang.String load)
          create a new character vector of the length one
REXPString(java.lang.String[] load)
          create a new character vector
REXPString(java.lang.String[] load, REXPList attr)
          create a new character vector with attributes
 
Method Summary
 java.lang.Object asNativeJavaObject()
          attempt to represent the REXP by a native Java object and return it.
 java.lang.String[] asStrings()
          returns the contents as an array of Strings (if supported by the represented object)
 boolean[] isNA()
          returns a boolean vector of the same length as this vector with true for NA values and false for any other values
 boolean isString()
          check whether the REXP object is a character vector (string)
 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, asBytes, asDouble, asDoubleMatrix, asDoubles, asFactor, asInteger, asIntegers, asList, asString, createDataFrame, createDoubleMatrix, dim, getAttribute, hasAttribute, inherits, isComplex, isEnvironment, isExpression, isFactor, isInteger, isLanguage, isList, isLogical, isNull, isNumeric, isPairList, isRaw, isRecursive, isReference, isSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

REXPString

public REXPString(java.lang.String load)
create a new character vector of the length one

Parameters:
load - first (and only) element of the vector

REXPString

public REXPString(java.lang.String[] load)
create a new character vector

Parameters:
load - string elements of the vector

REXPString

public REXPString(java.lang.String[] load,
                  REXPList attr)
create a new character vector with attributes

Parameters:
load - string elements of the vector
attr - attributes
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

isString

public boolean isString()
Description copied from class: REXP
check whether the REXP object is a character vector (string)

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

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

asStrings

public java.lang.String[] asStrings()
Description copied from class: REXP
returns the contents as an array of Strings (if supported by the represented object)

Overrides:
asStrings in class REXP

isNA

public boolean[] isNA()
Description copied from class: REXPVector
returns a boolean vector of the same length as this vector with true for NA values and false for any other values

Overrides:
isNA in class REXPVector
Returns:
a boolean vector of the same length as this vector with true for NA values and false for any other values

toDebugString

public java.lang.String toDebugString()
Description copied from class: REXP
returns representation that it useful for debugging (e.g. it includes attributes and may include vector values -- see REXP.maxDebugItems)

Overrides:
toDebugString in class REXPVector
Returns:
extended description of the obejct -- it may include vector values