]> gerrit.simantics Code Review - simantics/r.git/blob - bundles/org.simantics.r.scl/src/org/rosuda/REngine/REXPVector.java
Restructured R repository for Tycho POMless builds.
[simantics/r.git] / bundles / org.simantics.r.scl / src / org / rosuda / REngine / REXPVector.java
1 package org.rosuda.REngine;
2
3 /** abstract class representing all vectors in R */
4 public abstract class REXPVector extends REXP {
5         public REXPVector() { super(); }
6         
7         public REXPVector(REXPList attr) {
8                 super(attr);
9         }
10
11         /** returns the length of the vector (i.e. the number of elements)
12          *  @return length of the vector */
13         public abstract int length();
14
15         public boolean isVector() { return true; }
16
17         /** returns a boolean vector of the same length as this vector with <code>true</code> for NA values and <code>false</code> for any other values
18          *  @return a boolean vector of the same length as this vector with <code>true</code> for NA values and <code>false</code> for any other values */
19         public boolean[] isNA() {
20                 boolean a[] = new boolean[length()];
21                 return a;
22         }
23         
24         public String toString() {
25                 return super.toString()+"["+length()+"]";
26         }
27         
28         public String toDebugString() {
29                 return super.toDebugString()+"["+length()+"]";
30         }
31 }