protected String getNameFromSymbolInfo(VirtualFrame frame, RList symbol) { if (nameExtract == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); nameExtract = ExtractVectorNode.create(ElementAccessMode.SUBSCRIPT, true); } return RRuntime.asString(nameExtract.applyAccessField(frame, symbol, "name")); }
public String getDataAt(int index) { if (levels == null || levels.getLength() == 0) { return RRuntime.STRING_NA; } else { int val = ((RIntVector) vector).getDataAt(index); if (!vector.isComplete() && RRuntime.isNA(val)) { return RRuntime.STRING_NA; } else { String l = levels.getDataAt(val - 1); if (!levels.isComplete() && RRuntime.isNA(l)) { return "NA"; // for comparison } else { return l; } } } }
protected String lookupName(RList f) { if (f.getNames() != null) { RAbstractStringVector names = f.getNames(); for (int i = 0; i < names.getLength(); i++) { if (names.getDataAt(i).equals("name")) { String name = RRuntime.asString(f.getDataAt(i)); return name != null ? name : UNKNOWN_EXTERNAL_BUILTIN; } } } return UNKNOWN_EXTERNAL_BUILTIN; }