File: REXPVector.java

package info (click to toggle)
rjava 1.0-14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,188 kB
  • sloc: java: 13,223; ansic: 5,503; sh: 3,776; xml: 325; makefile: 250; perl: 33
file content (31 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.rosuda.REngine;

/** abstract class representing all vectors in R */
public abstract class REXPVector extends REXP {
	public REXPVector() { super(); }
	
	public REXPVector(REXPList attr) {
		super(attr);
	}

	/** returns the length of the vector (i.e. the number of elements)
	 *  @return length of the vector */
	public abstract int length();

	public boolean isVector() { return true; }

	/** 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
	 *  @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 */
	public boolean[] isNA() {
		boolean a[] = new boolean[length()];
		return a;
	}
	
	public String toString() {
		return super.toString()+"["+length()+"]";
	}
	
	public String toDebugString() {
		return super.toDebugString()+"["+length()+"]";
	}
}