Applies given {@code procedure} to each non-zero element of this vector.

@param procedure the vector procedure
517167
public void eachNonZero(VectorProcedure procedure) {
        VectorIterator it = nonZeroIterator();

        while (it.hasNext()) {
            double x = it.next();
            int i = it.index();
            procedure.apply(i, x);
        }
    }
912531
private void forEach(KTypeProcedure<? super KType> procedure, int fromIndex, final int toIndex) {
    final KType[] buffer = Intrinsics.<KType[]> cast(this.buffer);
    for (int i = fromIndex; i != toIndex; i = oneRight(i, buffer.length)) {
      procedure.apply(buffer[i]);
    }
  }
286596
public static <T1, T2> void forEachInBoth(List<T1> list1, List<T2> list2, Procedure2<? super T1, ? super T2> procedure)
    {
        if (list1 != null && list2 != null)
        {
            if (list1.size() == list2.size())
            {
                if (list1 instanceof RandomAccess && list2 instanceof RandomAccess)
                {
                    RandomAccessListIterate.forEachInBoth(list1, list2, procedure);
                }
                else
                {
                    Iterator<T1> iterator1 = list1.iterator();
                    Iterator<T2> iterator2 = list2.iterator();
                    int size = list2.size();
                    for (int i = 0; i < size; i++)
                    {
                        procedure.value(iterator1.next(), iterator2.next());
                    }
                }
            }
            else
            {
                throw new RuntimeException("Attempt to call forEachInBoth with two Lists of different sizes :"
                        + list1.size()
                        + ':'
                        + list2.size());
            }
        }
    }
59490
public static void setCatalogProcedurePartitionInfo(VoltCompiler compiler, Database db,
            Procedure procedure, ProcedurePartitionData partitionData) throws VoltCompilerException {
        ParititonDataReturnType partitionClauseData = resolvePartitionData(compiler, db, procedure,
                partitionData.m_tableName, partitionData.m_columnName, partitionData.m_paramIndex);
        procedure.setPartitionparameter(partitionClauseData.partitionParamIndex);
        procedure.setPartitioncolumn(partitionClauseData.partitionColumn);
        procedure.setPartitiontable(partitionClauseData.partitionTable);
        procedure.setSinglepartition(true);

        // handle a two partition procedure
        if (partitionData.isTwoPartitionProcedure()) {
            partitionClauseData = resolvePartitionData(compiler, db, procedure,
                    partitionData.m_tableName2, partitionData.m_columnName2, partitionData.m_paramIndex2);
            procedure.setPartitionparameter2(partitionClauseData.partitionParamIndex);
            procedure.setPartitioncolumn2(partitionClauseData.partitionColumn);
            procedure.setPartitiontable2(partitionClauseData.partitionTable);
            procedure.setSinglepartition(false);
        }
    }
1300806
public static void forEachCodePoint(String string, CodePointProcedure procedure)
    {
        int size = string.length();
        for (int i = 0; i < size; )
        {
            int codePoint = string.codePointAt(i);
            procedure.value(codePoint);
            i += Character.charCount(codePoint);
        }
    }
450213
protected function applyRule(MethodNode $method)
    {
        foreach ($method->findChildrenOfType('Statement') as $statement) {
            $this->checkForbiddenStatement($method, $statement);
            $this->checkSwitchStatement($method, $statement);
        }
    }
1291412
public static <K, V> void forEachKeyValue(Map<K, V> map, Procedure2<? super K, ? super V> procedure)
    {
        if (map == null)
        {
            throw new IllegalArgumentException("Cannot perform a forEachKeyValue on null");
        }

        if (MapIterate.notEmpty(map))
        {
            if (map instanceof UnsortedMapIterable)
            {
                ((MapIterable<K, V>) map).forEachKeyValue(procedure);
            }
            else
            {
                IterableIterate.forEach(map.entrySet(), new MapEntryToProcedure2<K, V>(procedure));
            }
        }
    }
242171
public static <K, V> void forEachKeyValue(
            Map<K, V> map,
            Procedure2<? super K, ? super V> procedure,
            int minForkSize,
            int taskCount)
    {
        if (map.size() > minForkSize)
        {
            Procedure<Pair<K, V>> pairProcedure = new PairProcedure<K, V>(procedure);
            ParallelIterate.forEach(MapIterate.toListOfPairs(map), new PassThruProcedureFactory<Procedure<Pair<K, V>>>(pairProcedure), new PassThruCombiner<Procedure<Pair<K, V>>>(), minForkSize, taskCount);
        }
        else
        {
            MapIterate.forEachKeyValue(map, procedure);
        }
    }
564096
def p_procedure_def(t):
    """"""
    global name_dict
    tid = t[2]
    value = t[8]
    lineno = t.lineno(1)
    if id_unique(tid, 'procedure', lineno):
        name_dict[tid] = const_info(tid, value, lineno)
784061
public static void apply(Program program, TreeGP manager)
   {
      int iMaxProgramDepth = manager.getMaxProgramDepth();
      TGPMutationStrategy method = manager.getMutationStrategy();
      RandEngine randEngine = manager.getRandEngine();
      
      if (method == TGPMutationStrategy.MUTATION_SUBTREE || method == TGPMutationStrategy.MUTATION_SUBTREE_KINNEAR)
      {
         TreeNode node = program.anyNode(randEngine)._1();
         int depth = program.calcDepth();

         TreeNode root = program.getRoot();

         if (method == TGPMutationStrategy.MUTATION_SUBTREE)
         {
            int node_depth = root.depth2Node(node);
            node.getChildren().clear();

            node.setPrimitive(program.anyPrimitive(randEngine));

            if (!node.getPrimitive().isTerminal())
            {
               int max_depth = iMaxProgramDepth - node_depth;
               TreeGenerator.createWithDepth(program, node, max_depth, TGPInitializationStrategy.INITIALIZATION_METHOD_GROW, randEngine);
            }
         }
         else
         {
            int subtree_depth = root.depth2Node(node);
            int current_depth = depth - subtree_depth;
            int max_depth = (int)(depth * 1.15) - current_depth;

            node.getChildren().clear();
            node.setPrimitive(program.anyPrimitive(randEngine));

            if (!node.getPrimitive().isTerminal())
            {
               TreeGenerator.createWithDepth(program, node, max_depth, TGPInitializationStrategy.INITIALIZATION_METHOD_GROW, randEngine);
            }
         }
      }
      else if (method == TGPMutationStrategy.MUTATION_HOIST)
      {
         TreeNode node = program.anyNode(randEngine)._1();

         if (node != program.getRoot())
         {
            program.setRoot(node);
         }
      }
      else if (method == TGPMutationStrategy.MUTATION_SHRINK)
      {
         TreeNode node = program.anyNode(randEngine)._1();
         node.getChildren().clear();
         node.setPrimitive(program.anyTerminal(randEngine));
      }

      program.calcDepth();
      program.calcLength();
   }
817244
StatementDMQL compileCallStatement(RangeVariable[] outerRanges,
                                       boolean isStrictlyProcedure) {

        read();

        if (isIdentifier()) {
            checkValidCatalogName(token.namePrePrefix);

            RoutineSchema routineSchema =
                (RoutineSchema) database.schemaManager.findSchemaObject(
                    token.tokenString,
                    session.getSchemaName(token.namePrefix),
                    SchemaObject.PROCEDURE);

            if (routineSchema != null) {
                read();

                HsqlArrayList list = new HsqlArrayList();

                readThis(Tokens.OPENBRACKET);

                if (token.tokenType == Tokens.CLOSEBRACKET) {
                    read();
                } else {
                    while (true) {
                        Expression e = XreadValueExpression();

                        list.add(e);

                        if (token.tokenType == Tokens.COMMA) {
                            read();
                        } else {
                            readThis(Tokens.CLOSEBRACKET);

                            break;
                        }
                    }
                }

                Expression[] arguments = new Expression[list.size()];

                list.toArray(arguments);

                Routine routine =
                    routineSchema.getSpecificRoutine(arguments.length);
                HsqlList unresolved = null;

                for (int i = 0; i < arguments.length; i++) {
                    Expression e = arguments[i];

                    if (e.isParam()) {
                        e.setAttributesAsColumn(
                            routine.getParameter(i),
                            routine.getParameter(i).isWriteable());
                    } else {
                        int paramMode =
                            routine.getParameter(i).getParameterMode();

                        unresolved =
                            arguments[i].resolveColumnReferences(outerRanges,
                                unresolved);

                        if (paramMode
                                != SchemaObject.ParameterModes.PARAM_IN) {
                            if (e.getType() != OpTypes.VARIABLE) {
                                throw Error.error(ErrorCode.X_42603);
                            }
                        }
                    }
                }

                ExpressionColumn.checkColumnsResolved(unresolved);

                for (int i = 0; i < arguments.length; i++) {
                    arguments[i].resolveTypes(session, null);
                }

                StatementDMQL cs = new StatementProcedure(session, routine,
                    arguments, compileContext);

                return cs;
            }
        }

        if (isStrictlyProcedure) {
            throw Error.error(ErrorCode.X_42501, token.tokenString);
        }

        Expression expression = this.XreadValueExpression();
        HsqlList unresolved = expression.resolveColumnReferences(outerRanges,
            null);

        ExpressionColumn.checkColumnsResolved(unresolved);
        expression.resolveTypes(session, null);

//        expression.paramMode = PARAM_OUT;
        StatementDMQL cs = new StatementProcedure(session, expression,
            compileContext);

        return cs;
    }
1030424
public static <K, V> void forEachValue(Map<K, V> map, Procedure<? super V> procedure)
    {
        if (map == null)
        {
            throw new IllegalArgumentException("Cannot perform a forEachValue on null");
        }

        if (MapIterate.notEmpty(map))
        {
            if (map instanceof UnsortedMapIterable)
            {
                ((MapIterable<K, V>) map).forEachValue(procedure);
            }
            else
            {
                IterableIterate.forEach(map.values(), procedure);
            }
        }
    }
390550
public static <K, V> void forEachKey(Map<K, V> map, Procedure<? super K> procedure)
    {
        if (map == null)
        {
            throw new IllegalArgumentException("Cannot perform a forEachKey on null");
        }

        if (MapIterate.notEmpty(map))
        {
            if (map instanceof UnsortedMapIterable)
            {
                ((MapIterable<K, V>) map).forEachKey(procedure);
            }
            else
            {
                IterableIterate.forEach(map.keySet(), procedure);
            }
        }
    }
722594
public <T extends Object> void forEachWithShortcut(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super T> procedure) {
    int _size = IterableExtensions.size(elements);
    boolean _equals = (_size == 1);
    if (_equals) {
      T _head = IterableExtensions.<T>head(elements);
      ObjectExtensions.<T>operator_doubleArrow(_head, procedure);
    } else {
      appendable.append("{");
      final Procedure1<LoopParams> _function = (LoopParams it) -> {
        it.setPrefix(" ");
        it.setSeparator(", ");
        it.setSuffix(" ");
      };
      this.<T>forEach(appendable, elements, _function, procedure);
      appendable.append("}");
    }
  }
159953
private function serializeProcedure(ProcedureBlockInterface $procedure): int
    {
        $index = $this->allocateIndex();

        $serialized = [
            static::TYPE                       => static::TYPE__PROCEDURE,
            static::PROCEDURE_EXECUTE_CALLABLE => $procedure->getExecuteCallable(),
        ];
        if ($procedure->getStartCallable() !== null) {
            $serialized[static::PROCEDURE_START_CALLABLE] = $procedure->getStartCallable();
            $this->blocksWithStart[]                      = $index;
        }
        if ($procedure->getEndCallable() !== null) {
            $serialized[static::PROCEDURE_END_CALLABLE] = $procedure->getEndCallable();
            $this->blocksWithEnd[]                      = $index;
        }
        if (empty($procedure->getProperties()) === false) {
            $serialized[static::PROPERTIES] = $procedure->getProperties();
        }

        $this->serializedBlocks[$index] = $serialized;

        return $index;
    }
735276
@Override
  public <T extends KTypeProcedure<? super KType>> T descendingForEach(T procedure) {
    descendingForEach(procedure, head, tail);
    return procedure;
  }
640216
public void invokevirtual(ExecutableElement method) throws IOException
    {
        if (method.getEnclosingElement().getKind() == ElementKind.INTERFACE)
        {
            int index = subClass.resolveInterfaceMethodIndex(method);
            invokeinterface(index, argumentCount(method.getParameters()));
        }
        else
        {
            int index = subClass.resolveMethodIndex(method);
            invokevirtual(index);
        }
    }