1 /*******************************************************************************
\r
2 * Copyright (c) 2014, 2016 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.r.scl.variable;
\r
14 import org.rosuda.REngine.REXP;
\r
15 import org.rosuda.REngine.REXPInteger;
\r
16 import org.rosuda.REngine.REXPMismatchException;
\r
18 public class RListLengthNode implements RVariableNode {
\r
20 RVariableNode parent;
\r
22 public RListLengthNode(RVariableNode parent) {
\r
23 this.parent = parent;
\r
27 public REXP getValue() {
\r
28 REXP parentValue = parent.getValue();
\r
29 if (parentValue == null)
\r
33 return new REXPInteger(parentValue.length());
\r
34 } catch (REXPMismatchException e) {
\r
40 public String getName() {
\r
45 public RVariableNode getParent() {
\r