UNPKG

graph-builder

Version:

A graph builder library for modeling abstract graph structures.

71 lines 2.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const AbstractGraph_1 = require("./AbstractGraph"); /* * Copyright (C) 2016 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Modifications (C) 2019 Ben Sorohan */ /** * A class to allow {@link Graph} implementations to be backed by a {@link BaseGraph}. This is not * currently planned to be released as a general-purpose forwarding class. */ class ForwardingGraph extends AbstractGraph_1.AbstractGraph { nodes() { return this.delegate().nodes(); } /** * Defer to {@link AbstractGraph.edges} (based on {@link successors}) for full edges() * implementation. */ edgeCountValue() { return this.delegate().edges().size; } isDirected() { return this.delegate().isDirected(); } allowsSelfLoops() { return this.delegate().allowsSelfLoops(); } nodeOrder() { return this.delegate().nodeOrder(); } adjacentNodes(node) { return this.delegate().adjacentNodes(node); } predecessors(node) { return this.delegate().predecessors(node); } successors(node) { return this.delegate().successors(node); } degree(node) { return this.delegate().degree(node); } inDegree(node) { return this.delegate().inDegree(node); } outDegree(node) { return this.delegate().outDegree(node); } hasEdge(nodeU, nodeV) { return this.delegate().hasEdge(nodeU, nodeV); } hasEdgeConnectingEndpoints(endpoints) { return this.delegate().hasEdgeConnectingEndpoints(endpoints); } } exports.ForwardingGraph = ForwardingGraph; //# sourceMappingURL=ForwardingGraph.js.map