Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/Traversal.java
package org.softwareheritage.graph; | package org.softwareheritage.graph; | ||||
import java.util.ArrayDeque; | import java.util.ArrayDeque; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.HashMap; | import java.util.HashMap; | ||||
import java.util.HashSet; | import java.util.HashSet; | ||||
import java.util.LinkedList; | import java.util.LinkedList; | ||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.Queue; | import java.util.Queue; | ||||
import java.util.Random; | import java.util.Random; | ||||
import java.util.Stack; | import java.util.Stack; | ||||
import java.util.function.Consumer; | import java.util.function.Consumer; | ||||
import java.util.function.LongConsumer; | import java.util.function.LongConsumer; | ||||
import org.softwareheritage.graph.server.Endpoint; | |||||
import it.unimi.dsi.big.webgraph.LazyLongIterator; | import it.unimi.dsi.big.webgraph.LazyLongIterator; | ||||
/** | /** | ||||
* Traversal algorithms on the compressed graph. | * Traversal algorithms on the compressed graph. | ||||
* <p> | * <p> | ||||
* Internal implementation of the traversal API endpoints. These methods only input/output internal | |||||
* long ids, which are converted in the {@link Endpoint} higher-level class to {@link SWHID}. | |||||
* | * | ||||
* @author The Software Heritage developers | * @author The Software Heritage developers | ||||
* @see Endpoint | |||||
*/ | */ | ||||
public class Traversal { | public class Traversal { | ||||
/** Graph used in the traversal */ | /** Graph used in the traversal */ | ||||
SwhBidirectionalGraph graph; | SwhBidirectionalGraph graph; | ||||
/** Type filter on the returned nodes */ | /** Type filter on the returned nodes */ | ||||
AllowedNodes nodesFilter; | AllowedNodes nodesFilter; | ||||
/** Restrictions on which edges can be traversed */ | /** Restrictions on which edges can be traversed */ | ||||
▲ Show 20 Lines • Show All 579 Lines • Show Last 20 Lines |