private void buildPropagationPath() { byte[] state = new byte[types.length]; int[] path = new int[types.length]; int pathSize = 0; IntStack stack = new IntStack(); for (int i = 0; i < graph.size(); ++i) { if (graph.incomingEdgesCount(i) == 0 && types[i] != null) { stack.push(i); } } while (!stack.isEmpty()) { int node = stack.pop(); if (state[node] == FRESH) { state[node] = VISITING; stack.push(node); for (int successor : graph.outgoingEdges(node)) { if (state[successor] == FRESH) { stack.push(successor); } } } else if (state[node] == VISITING) { path[pathSize++] = node; state[node] = VISITED; } } propagationPath = Arrays.copyOf(path, pathSize); }
procStack.push(i); procStack.push(0); nodeLowLink[v] = index; index++; stack.push(v); nodeOnStack[v] = true; procStack.push(v); procStack.push(3); procStack.push(w); procStack.push(v); procStack.push(1); procStack.push(w); procStack.push(v); procStack.push(2); procStack.push(w); procStack.push(0); } else if (nodeOnStack[w]) { nodeLowLink[v] = Math.min(nodeLowLink[v], nodeIndex[w]);
/** * Vararg-signature method for pushing elements at the top of the stack. * <p> * <b>This method is handy, but costly if used in tight loops (anonymous array * passing)</b> * </p> */ /* */ public final void push(int... elements) { push(elements, 0, elements.length); }
/** * Create a stack by pushing a variable number of arguments to it. */ /* */ public static IntStack from(int... elements) { final IntStack stack = new IntStack(elements.length); stack.push(elements); return stack; }
/** * Vararg-signature method for pushing elements at the top of the stack. * <p> * <b>This method is handy, but costly if used in tight loops (anonymous array * passing)</b> * </p> */ /* */ public final void push(int... elements) { push(elements, 0, elements.length); }
/** * push value onto the pushStack * * @param value */ public void push(int value) { pushStack().push(value); }
public void startElement(String namespaceURI, String localName, String qName, Attributes attrs) throws SAXException { pathSegments.push(path.length()); path.append('/').append(localName); text.setLength(0); String pathAsString = path.toString(); if (triggers.containsKey(pathAsString)) { triggers.get(pathAsString).onElement(localName, pathAsString, attrs); } }
/** * push value onto the pushStack * * @param value */ public void push(int value) { pushStack().push(value); }
/** * Create a stack by pushing a variable number of arguments to it. */ /* */ public static IntStack from(int... elements) { final IntStack stack = new IntStack(elements.length); stack.push(elements); return stack; }
/** * */ public void endDocument() { documentMarkers.push(input.size()); }
private void strongConnect(int node) { lowLink[node] = index; indices[node] = index; index++; stack.push(node); onStack.set(node); graph.forEachRelationship(node, Direction.OUTGOING, this); if (indices[node] == lowLink[node]) { relax(node); } }
private void strongConnect(int node) { lowLink[node] = index; indices[node] = index; index++; stack.push(node); onStack.set(node); graph.forEachRelationship(node, Direction.OUTGOING, this); if (indices[node] == lowLink[node]) { relax(node); } }
private void visit(int nodeId) { final int stackSize = stack.size(); index[nodeId] = stackSize; stack.push(nodeId); boundaries.push(stackSize); push(Action.POSTVISIT, nodeId); graph.forEachRelationship(nodeId, Direction.OUTGOING, (sourceNodeId, targetNodeId, relationId) -> { push(Action.VISITEDGE, targetNodeId); return true; }); }
private void visit(int nodeId) { final int stackSize = stack.size(); index[nodeId] = stackSize; stack.push(nodeId); boundaries.push(stackSize); push(Action.POSTVISIT, nodeId); graph.forEachRelationship(nodeId, Direction.OUTGOING, (sourceNodeId, targetNodeId, relationId) -> { push(Action.VISITEDGE, targetNodeId); return true; }); }
private void strongConnect(int node) { if (indices.containsKey(node)) { return; } lowLink.put(node, index); indices.put(node, index); index++; stack.push(node); onStack.set(node); graph.forEachRelationship(node, Direction.OUTGOING, this::accept); if (indices.get(node) == lowLink.get(node)) { relax(node); } }