public MutableInt postIncrement(MutableInt x) { int valueBeforeIncrement = x.intValue(); x.add(1); return new MutableInt(valueBeforeIncrement); }
public void add(double d) { sum.add(d); count.add(1); }
public void execute(Object input) { TableCell currentCell = (TableCell)input; column.add(currentCell.getColspan()); } });
Map map = new HashMap (); MutableInt newValue = new MutableInt (1); // default = inc MutableInt oldValue = map.put (key, newValue); if (oldValue != null) { newValue.add(oldValue); // old + inc }
public void execute(Object input) { TableColumn currentColumn = (TableColumn)input; columnIndex.add(currentColumn.getColspan()); } });
@Override public Object visit(ASTAndNode node, Object data) { List<JexlNode> otherNodes = new ArrayList<>(); Map<LiteralRange<?>,List<JexlNode>> ranges = JexlASTHelper.getBoundedRangesIndexAgnostic(node, otherNodes, true); // count each bounded range as 1 ((MutableInt) data).add(ranges.size()); // and recurse on the other nodes for (JexlNode otherNode : otherNodes) { otherNode.jjtAccept(this, data); } return data; }
void foo() { final MutableInt a = new MutableInt(3); new Runnable() { @Override public void run() { a.add(3); } }; }
@Override public Output apply(Input input) { index.add(1); return mapper.apply(index.intValue(), input); } });
count.add(1); String alias = "alias" + String.valueOf(count); String allaggmeasures = aggmeasures.append(measure).append(" as ").append(alias).toString();
@Override public boolean handle(PrismObject<OrgType> object, OperationResult parentResult) { LOGGER.trace("Processing {}", object); handleAdd(object.getOid(), getParentOidsFromObject(object), context, session); orgsProcessed.add(1); int currentState = orgsProcessed.intValue(); if (currentState % 100 == 0) { LOGGER.info("{} organizations processed (out of {})", currentState, orgsTotal); } return true; } };
count.add(1); String alias = "alias" + String.valueOf(count); String allaggmeasures = aggmeasures.append(measure).append(" as ").append(alias).toString();
/** * Get number of fact columns used in the an expression * * @param node * @param count * @return Number of fact columns used in expression */ protected int getNumFactTableInExpressions(ASTNode node, MutableInt count) { if (node == null) { log.debug("ASTNode is null "); return 0; } if (node.getToken().getType() == HiveParser.TOK_TABLE_OR_COL) { String factAlias = getFactAlias(); String table = node.getChild(0).getText(); if (table.equals(factAlias)) { count.add(1); } } for (int i = 0; i < node.getChildCount(); i++) { ASTNode child = (ASTNode) node.getChild(i); getNumFactTableInExpressions(child, count); } return count.intValue(); }
/** * Get number of fact columns used in the an expression * * @param node * @param count * @return Number of fact columns used in expression */ protected int getNumFactTableInExpressions(ASTNode node, MutableInt count) { if (node == null) { log.debug("ASTNode is null "); return 0; } if (node.getToken().getType() == HiveParser.TOK_TABLE_OR_COL) { String factAlias = getFactAlias(); String table = node.getChild(0).getText(); if (table.equals(factAlias)) { count.add(1); } } for (int i = 0; i < node.getChildCount(); i++) { ASTNode child = (ASTNode) node.getChild(i); getNumFactTableInExpressions(child, count); } return count.intValue(); }