com.ibm.wala.util.graph.traverse.DFSPathFinder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.ibm.wala.util Show documentation
Show all versions of com.ibm.wala.util Show documentation
T. J. Watson Libraries for Analysis
/*
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*/
package com.ibm.wala.util.graph.traverse;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.Iterator2Iterable;
import com.ibm.wala.util.collections.NonNullSingletonIterator;
import com.ibm.wala.util.graph.Graph;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import org.jspecify.annotations.Nullable;
/**
* This class searches depth-first search for node that matches some criteria. If found, it reports
* a path to the first node found.
*
* This class follows the outNodes of the graph nodes to define the graph, but this behavior can
* be changed by overriding the getConnected method.
*/
public class DFSPathFinder extends ArrayList {
public static final long serialVersionUID = 9939900773328288L;
/** The graph to search */
protected final Graph G;
/** The Filter which defines the target set of nodes to find */
private final Predicate filter;
/** an enumeration of all nodes to search from */
private final Iterator roots;
/** An iterator of child nodes for each node being searched */
protected final Map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy