Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/Subgraph.java
package org.softwareheritage.graph; | package org.softwareheritage.graph; | ||||
import it.unimi.dsi.big.webgraph.ImmutableGraph; | import it.unimi.dsi.big.webgraph.ImmutableGraph; | ||||
import it.unimi.dsi.big.webgraph.LazyLongIterator; | import it.unimi.dsi.big.webgraph.LazyLongIterator; | ||||
import it.unimi.dsi.big.webgraph.NodeIterator; | import it.unimi.dsi.big.webgraph.NodeIterator; | ||||
import java.util.NoSuchElementException; | import java.util.NoSuchElementException; | ||||
public class Subgraph extends ImmutableGraph { | public class Subgraph extends ImmutableGraph { | ||||
private final Graph underlyingGraph; | private final SwhBidirectionalGraph underlyingGraph; | ||||
public final AllowedNodes allowedNodeTypes; | public final AllowedNodes allowedNodeTypes; | ||||
private long nodeCount = -1; | private long nodeCount = -1; | ||||
/** | /** | ||||
* Constructor. | * Constructor. | ||||
* | * | ||||
*/ | */ | ||||
public Subgraph(Graph underlyingGraph, AllowedNodes allowedNodeTypes) { | public Subgraph(SwhBidirectionalGraph underlyingGraph, AllowedNodes allowedNodeTypes) { | ||||
this.underlyingGraph = underlyingGraph.copy(); | this.underlyingGraph = underlyingGraph.copy(); | ||||
this.allowedNodeTypes = allowedNodeTypes; | this.allowedNodeTypes = allowedNodeTypes; | ||||
} | } | ||||
/** | /** | ||||
* Return a flyweight copy of the graph. | * Return a flyweight copy of the graph. | ||||
*/ | */ | ||||
@Override | @Override | ||||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |