本文整理了Java中edu.isi.karma.rep.Node.setValue()
方法的一些代码示例,展示了Node.setValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setValue()
方法的具体详情如下:
包路径:edu.isi.karma.rep.Node
类名称:Node
方法名:setValue
暂无
代码示例来源:origin: usc-isi-i2/Web-Karma
/**
* @param hNodeId
* @param value
* @param status
* @return the row containing the modified node.
*/
public Row setValue(String hNodeId, CellValue value,
Node.NodeStatus status, RepFactory factory) {
getNode(hNodeId).setValue(value, status, factory);
return this;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
/**
* Convenience method to set values in nodes in rows.
*
* @param hNodeId
* @param value
* @param status
* specifies the status of the value
* @return the row containing the modified node.
*/
public Row setValue(String hNodeId, String value, Node.NodeStatus status,
RepFactory factory) {
getNode(hNodeId).setValue(value, status, factory);
return this;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public void setValue(String value, NodeStatus status, RepFactory factory) {
setValue(new StringCellValue(value), status, factory);
}
代码示例来源:origin: usc-isi-i2/Web-Karma
private void populateRowsWithDefaultValues(Worksheet worksheet, RepFactory factory) {
SuperSelection selection = getSuperSelection(worksheet);
HNodePath selectedPath = null;
List<HNodePath> columnPaths = worksheet.getHeaders().getAllPaths();
for (HNodePath path : columnPaths) {
if (path.getLeaf().getId().equals(newHNodeId)) {
selectedPath = path;
}
}
Collection<Node> nodes = new ArrayList<>(Math.max(1000, worksheet.getDataTable().getNumRows()));
worksheet.getDataTable().collectNodes(selectedPath, nodes, selection);
for (Node node : nodes) {
node.setValue(this.defaultValue, NodeStatus.original, factory);
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
private boolean addValues(Node node, String value, RepFactory factory, Table table) {
Worksheet worksheet = factory.getWorksheet(worksheetId);
SuperSelection selection = getSuperSelection(worksheet);
boolean flag = true;
if (table != null) {
for (Row r : table.getRows(0, table.getNumRows(), selection)) {
Node n = r.getNeighbor(node.getHNodeId());
if (n.getValue() != null && n.getValue().asString().compareTo(value) == 0) {
flag = false;
break;
}
}
}
if (flag)
node.setValue(value, NodeStatus.original, factory);
return flag;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public UpdateContainer doIt(Workspace workspace) throws CommandException {
Node node = workspace.getFactory().getNode(nodeIdArg);
SuperSelection sel = getSuperSelection(workspace);
inputColumns.clear();
outputColumns.clear();
inputColumns.add(node.getHNodeId());
outputColumns.add(node.getHNodeId());
previousValue = node.getValue();
previousStatus = node.getStatus();
if (node.hasNestedTable()) {
throw new CommandException(this, "Cell " + nodeIdArg
+ " has a nested table. It cannot be edited.");
}
node.setValue(newValueArg, Node.NodeStatus.edited,
workspace.getFactory());
WorksheetUpdateFactory.detectSelectionStatusChange(worksheetId, workspace, this);
UpdateContainer uc = WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(worksheetId, sel, workspace.getContextId());
uc.add(new NodeChangedUpdate(worksheetId,
nodeIdArg, newValueArg, Node.NodeStatus.edited));
return uc;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
@Override
public UpdateContainer undoIt(Workspace workspace) {
Node node = workspace.getFactory().getNode(nodeIdArg);
SuperSelection sel = getSuperSelection(workspace);
node.setValue(previousValue, previousStatus, workspace.getFactory());
UpdateContainer uc = WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(worksheetId, sel, workspace.getContextId());
uc.add(new NodeChangedUpdate(worksheetId,
nodeIdArg, previousValue, previousStatus));
return uc;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
node.setValue(oldNodeValueMap.get(node), oldNodeStatusMap.get(node), workspace.getFactory());
代码示例来源:origin: usc-isi-i2/Web-Karma
Node oldnode = cur.getNode(value.getId());
Row tmprow = newnode.getNestedTable().addRow(factory);
tmprow.getNeighborByColumnName("Values", factory).setValue(oldnode.getValue().asString(), oldnode.getStatus(), factory);
代码示例来源:origin: usc-isi-i2/Web-Karma
Row dest = newNode.getNestedTable().addRow(factory);
Node destNode = dest.getNeighborByColumnName("Values", factory);
destNode.setValue(rowValues[i], NodeStatus.original, factory);
代码示例来源:origin: usc-isi-i2/Web-Karma
private void setCollectedNodeValues(HNodePath path, List<String> nodes,
List<Row> rows, int nodeIdx, RepFactory factory, SuperSelection sel) {
RowIterator: for (Row r : rows) {
if (sel.isSelected(r))
continue;
Node n = r.getNode(path.getFirst().getId());
if (n == null) {
continue RowIterator;
}
// Check if the path has only one HNode
if (path.getRest() == null || path.getRest().isEmpty()) {
n.setValue(nodes.get(nodeIdx++), NodeStatus.original, factory);
continue RowIterator;
}
// Check if the node has a nested table
if (n.hasNestedTable()) {
int numRows = n.getNestedTable().getNumRows();
if (numRows == 0)
continue RowIterator;
List<Row> rowsNestedTable = n.getNestedTable().getRows(0,
numRows, sel);
if (rowsNestedTable != null && !rowsNestedTable.isEmpty()) {
setCollectedNodeValues(path.getRest(), nodes,
rowsNestedTable, nodeIdx, factory, sel);
continue RowIterator;
}
}
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
Node oldnode = cur.getNode(value.getId());
Row tmprow = newnode.getNestedTable().addRow(factory);
tmprow.getNeighborByColumnName("Values", factory).setValue(oldnode.getValue().asString(), oldnode.getStatus(), factory);
代码示例来源:origin: usc-isi-i2/Web-Karma
public static void cloneDataTableExistingRow(Row oldRow, Row newRow, List<HNode> hNodes, RepFactory factory, Map<String, String> mapping, SuperSelection sel) {
for (HNode hnode : hNodes) {
HNode newHNode = factory.getHNode(mapping.get(hnode.getId()));
Node oldNode = oldRow.getNode(hnode.getId());
Node newNode = newRow.getNode(newHNode.getId());
if (oldNode == null)
continue;
if (!oldNode.hasNestedTable()) {
newNode.setValue(oldNode.getValue(), oldNode.getStatus(), factory);
}
else {
cloneDataTable(oldNode.getNestedTable(), newNode.getNestedTable(), newHNode.getNestedTable(), hnode.getNestedTable().getSortedHNodes(), factory, sel);
}
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public static Row cloneDataTable(Row oldRow, Table newDataTable, HTable newHTable, List<HNode> hNodes, RepFactory factory, SuperSelection sel) {
Row newRow = newDataTable.addRow(factory);
for (HNode hnode : hNodes) {
HNode newHNode = newHTable.getHNodeFromColumnName(hnode.getColumnName());
if (newHNode == null)
continue;
Node oldNode = oldRow.getNode(hnode.getId());
Node newNode = newRow.getNode(newHNode.getId());
if (oldNode == null)
continue;
if (!oldNode.hasNestedTable()) {
newNode.setValue(oldNode.getValue(), oldNode.getStatus(), factory);
}
else {
cloneDataTable(oldNode.getNestedTable(), newNode.getNestedTable(), newHNode.getNestedTable(), hnode.getNestedTable().getSortedHNodes(), factory, sel);
}
}
return newRow;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public static void cloneDataTable(Table oldDataTable, Table newDataTable, HTable newHTable, List<HNode> hNodes, RepFactory factory, SuperSelection sel) {
ArrayList<Row> rows = oldDataTable.getRows(0, oldDataTable.getNumRows(), sel);
for (Row row : rows) {
Row newrow = newDataTable.addRow(factory);
for (HNode hnode : hNodes) {
HNode newHNode = newHTable.getHNodeFromColumnName(hnode.getColumnName());
Node oldNode = row.getNode(hnode.getId());
Node newNode = newrow.getNode(newHNode.getId());
if (!oldNode.hasNestedTable()) {
newNode.setValue(oldNode.getValue(), oldNode.getStatus(), factory);
}
else {
cloneDataTable(oldNode.getNestedTable(), newNode.getNestedTable(), newHNode.getNestedTable(), hnode.getNestedTable().getSortedHNodes(), factory, sel);
}
}
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
parentRow.getNode(newHNodeId).setValue(PythonTransformationHelper.getPyObjectValueAsString(returnVal), Node.NodeStatus.original, factory);
内容来源于网络,如有侵权,请联系作者删除!