Differential D6953 Diff 25210 java/src/main/java/org/softwareheritage/graph/SwhBidirectionalGraph.java
Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/SwhBidirectionalGraph.java
Show All 12 Lines | |||||
* This class uses the {@link BidirectionalImmutableGraph} class internally to implement the | * This class uses the {@link BidirectionalImmutableGraph} class internally to implement the | ||||
* backward equivalent of graph operations ({@link SwhBidirectionalGraph#indegree(long)}, | * backward equivalent of graph operations ({@link SwhBidirectionalGraph#indegree(long)}, | ||||
* {@link SwhBidirectionalGraph#predecessors(long)}, etc.) by holding a reference to two | * {@link SwhBidirectionalGraph#predecessors(long)}, etc.) by holding a reference to two | ||||
* {@link SwhUnidirectionalGraph} (a forward graph and a backward graph). | * {@link SwhUnidirectionalGraph} (a forward graph and a backward graph). | ||||
* | * | ||||
* Both graphs share their graph properties in memory by storing references to the same | * Both graphs share their graph properties in memory by storing references to the same | ||||
* {@link SwhGraphProperties} object. | * {@link SwhGraphProperties} object. | ||||
* | * | ||||
* <pre> | |||||
* ┌──────────────┐ | |||||
* │ImmutableGraph◄────────┐ | |||||
* └────▲─────────┘ │extends | |||||
* │ │ | |||||
* │ ┌──────────┴────────────────┐ | |||||
* extends│ │BidirectionalImmutableGraph│ | |||||
* │ └────────────▲──────────────┘ | |||||
* │ │extends | |||||
* ┌──────────────┴───────┐ ┌──────┴──────────────┐ | |||||
* │SwhUnidirectionalGraph│◄────┤SwhBidirectionalGraph│ | |||||
* └──┬──────────────┬────┘ └────────┬───────────┬┘ | |||||
* │ │ contains x2 │ │ | |||||
* │ │ │ │ | |||||
* │ implements│ │implements │ | |||||
* │ ┌▼──────────┐ │ │ | |||||
* │ │SwhGraph(I)◄────────┘ │ | |||||
* contains │ └───────────┘ │contains | |||||
* │ │ | |||||
* │ ┌──────────────────┐ │ | |||||
* └────────────►SwhGraphProperties◄──────────────┘ | |||||
* └──────────────────┘ | |||||
* </pre> | |||||
* | |||||
* @author The Software Heritage developers | * @author The Software Heritage developers | ||||
* @see SwhUnidirectionalGraph | * @see SwhUnidirectionalGraph | ||||
*/ | */ | ||||
public class SwhBidirectionalGraph extends BidirectionalImmutableGraph implements SwhGraph { | public class SwhBidirectionalGraph extends BidirectionalImmutableGraph implements SwhGraph { | ||||
/** Property data of the graph (id/type mappings etc.) */ | /** Property data of the graph (id/type mappings etc.) */ | ||||
private final SwhGraphProperties properties; | private final SwhGraphProperties properties; | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |