org.rosuda.REngine
Class REXPList

java.lang.Object
  extended by org.rosuda.REngine.REXP
      extended by org.rosuda.REngine.REXPVector
          extended by org.rosuda.REngine.REXPList
Direct Known Subclasses:
REXPLanguage

public class REXPList
extends REXPVector

Represents a pairlist in R. Unlike the actual internal R implementation this one does not use CAR/CDR/TAG linked representation but a @link{RList} object.


Field Summary
 
Fields inherited from class org.rosuda.REngine.REXP
attr, maxDebugItems
 
Constructor Summary
REXPList(REXP value, java.lang.String name)
           
REXPList(RList list)
           
REXPList(RList list, 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 isPairList()
          check whether the REXP object is a pair-list
 boolean isRecursive()
          check whether the REXP object is a recursive obejct
 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)
 java.lang.String toString()
          returns a string description of the object
 
Methods inherited from class org.rosuda.REngine.REXPVector
isNA, isVector
 
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, isNull, isNumeric, isRaw, isReference, isString, isSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

REXPList

public REXPList(RList list)

REXPList

public REXPList(RList list,
                REXPList attr)

REXPList

public REXPList(REXP value,
                java.lang.String name)
Method Detail

asNativeJavaObject

public java.lang.Object asNativeJavaObject()
                                    throws REXPMismatchException
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
Throws:
REXPMismatchException

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

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

isPairList

public boolean isPairList()
Description copied from class: REXP
check whether the REXP object is a pair-list

Overrides:
isPairList in class REXP
Returns:
true if the receiver is a pair-list, false otherwise

isRecursive

public boolean isRecursive()
Description copied from class: REXP
check whether the REXP object is a recursive obejct

Overrides:
isRecursive in class REXP
Returns:
true if the receiver is a recursive object, 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

toString

public java.lang.String toString()
Description copied from class: REXP
returns a string description of the object

Overrides:
toString in class REXPVector
Returns:
string describing the object - it can be of an arbitrary form and used only for debugging (do not confuse with REXP.asString() for accessing string REXPs)

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