Performs an action for each element of this stream.

<p>This is a terminal operation.

@param action  the action to be performed on each element
185184
public void forEach(@NotNull DoubleConsumer action) {
        while (iterator.hasNext()) {
            action.accept(iterator.nextDouble());
        }
    }
1033526
private final void reduce(ParserAction action) throws ParserException {
	try {
	    Production production = getGrammar().getProduction(action.getParameter());
	    for (int i = 0; i < production.getConstructions().size(); i++) {
		/*
		 * The for loop is run as many times as the production contains constructions
		 * which are added up for an AST node.
		 */
		stateStack.pop();
	    }
	    actionStack.add(action);
	    ParserAction gotoAction = parserTable.getAction(stateStack.peek(), new NonTerminal(production.getName()));
	    if (gotoAction.getAction() == ActionType.ERROR) {
		error();
		return;
	    }
	    stateStack.push(gotoAction.getParameter());
	} catch (GrammarException e) {
	    logger.error(e.getMessage(), e);
	    throw new ParserException(e.getMessage());
	}
    }
1278062
public void addActionButton(final ToolbarAction action) {
		final IButton button = new IButton();
		button.setWidth(buttonSize);
		button.setHeight(buttonSize);
		button.setIconSize(buttonSize - WidgetLayout.toolbarStripHeight);
		button.setIcon(action.getIcon());
		button.setActionType(SelectionType.BUTTON);
		button.addClickHandler(action);
		button.setShowRollOver(false);
		button.setShowFocused(false);
		button.setTooltip(action.getTooltip());
		button.setDisabled(action.isDisabled());

		if (getMembers() != null && getMembers().length > 0) {
			LayoutSpacer spacer = new LayoutSpacer();
			spacer.setWidth(2);
			super.addMember(spacer);
		}
		action.addToolbarActionHandler(new ToolbarActionHandler() {

			public void onToolbarActionDisabled(ToolbarActionDisabledEvent event) {
				button.setDisabled(true);
			}

			public void onToolbarActionEnabled(ToolbarActionEnabledEvent event) {
				button.setDisabled(false);
			}
		});
		super.addMember(button);
	}
69127
protected void processActions(Element element, PdfAction action, ArrayList allActions) {
        if (element.type() == Element.ANCHOR) {
            String url = ((Anchor) element).getReference();
            if (url != null) {
                action = new PdfAction(url);
            }
        }
        Iterator i;
        switch (element.type()) {
            case Element.PHRASE:
            case Element.SECTION:
            case Element.ANCHOR:
            case Element.CHAPTER:
            case Element.LISTITEM:
            case Element.PARAGRAPH:
                for (i = ((ArrayList) element).iterator(); i.hasNext();) {
                    processActions((Element) i.next(), action, allActions);
                }
                break;
            case Element.CHUNK:
                allActions.add(action);
                break;
            case Element.LIST:
                for (i = ((List) element).getItems().iterator(); i.hasNext();) {
                    processActions((Element) i.next(), action, allActions);
                }
                break;
            default:
                int n = element.getChunks().size();
                while (n-- > 0)
                    allActions.add(action);
                break;
        }
    }
682358
private static void addAction(@Nonnull Computer c, @Nonnull Action a) {
        try {
            c.addAction(a);
        } catch (UnsupportedOperationException x) {
            try {
                Field actionsF = Actionable.class.getDeclaredField("actions");
                actionsF.setAccessible(true);
                @SuppressWarnings("unchecked")
                List<Action> actions = (List) actionsF.get(c);
                actions.add(a);
            } catch (Exception x2) {
                LOGGER.log(Level.WARNING, null, x2);
            }
        }
    }
177068
private final void shift(ParserAction action) {
	stateStack.push(action.getParameter());
	actionStack.add(action);
	streamPosition++;
	shiftIgnoredTokens();
    }
112669
public CmdLineAction onSwitch(Consumer<@NonNull String> action) {
		SwitchCmdLineAction switchAction = new SwitchCmdLineAction(action);

		this.switchActions.add(switchAction);
		return switchAction;
	}
636685
public void addAction(M element, char value)
    {
        actions.put(element, Character.valueOf(value));
    }
601523
@Override
    public void actionPerformed(ActionEvent e) {
        String cmd = e.getActionCommand();
        if (cmd.equals("Cut")) {
            consoleTextArea.cut();
        } else if (cmd.equals("Copy")) {
            consoleTextArea.copy();
        } else if (cmd.equals("Paste")) {
            consoleTextArea.paste();
        }
    }
997619
public static void doAction(JTextField textField){
        String command = null;
        if(textField.getAction()!=null)
            command = (String)textField.getAction().getValue(Action.ACTION_COMMAND_KEY);
        ActionEvent event = null;
        
        for(ActionListener listener: textField.getActionListeners()){
            if(event==null)
                event = new ActionEvent(textField, ActionEvent.ACTION_PERFORMED, command, System.currentTimeMillis(), 0);
            listener.actionPerformed(event);
        }
    }
507292
private void updateStopRunnable(final int action) {
        if (stopRunnable != null) {
            if (action == 0) {
                handler.removeCallbacks(stopRunnable);
            } else if (action == 1) {
                handler.removeCallbacks(stopRunnable);
                handler.postDelayed(stopRunnable, STOP_DELAY);
            }
        }
    }
449854
public void forEach(@NotNull final Consumer<? super T> action) {
        while (iterator.hasNext()) {
            action.accept(iterator.next());
        }
    }
126342
public void addAction(ModelAction action, ModelActionListener listener)
    {
        
        synchronized(actionQueue) {
            this.actionQueue.add(new ModelActionEntry(action, listener));
        }
        
        wakeUp();
        
    }
713297
public Stream<T> onNext(final Action1<? super T> action) {
        return new Stream<T>() {
            @Override
            public Iterator<T> iterator() {
                return new ReadOnlyIterator<T>() {

                    Iterator<T> iterator = Stream.this.iterator();

                    @Override
                    public boolean hasNext() {
                        return iterator.hasNext();
                    }

                    @Override
                    public T next() {
                        final T next = iterator.next();
                        action.call(next);
                        return next;
                    }
                };
            }
        };
    }
117379
@UiThread
  @SafeVarargs public static <T extends View> void run(@NonNull T[] array,
      @NonNull Action<? super T>... actions) {
    for (int i = 0, count = array.length; i < count; i++) {
      for (Action<? super T> action : actions) {
        action.apply(array[i], i);
      }
    }
  }
1338277
@UiThread
  public static <T extends View> void run(@NonNull List<T> list,
      @NonNull Action<? super T> action) {
    for (int i = 0, count = list.size(); i < count; i++) {
      action.apply(list.get(i), i);
    }
  }
645998
public void forEach(Consumer<? super T> action) {
        connections.values().forEach(sync -> sync.doWithConnection(action));
    }