graph-builder
Version:
A graph builder library for modeling abstract graph structures.
45 lines • 1.66 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const AbstractBaseGraph_1 = require("./AbstractBaseGraph");
const Sets_1 = require("../collect/Sets");
/*
* 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
*/
/**
* This class provides a skeletal implementation of {@link Graph}. It is recommended to extend this
* class rather than implement {@link Graph} directly.
*/
class AbstractGraph extends AbstractBaseGraph_1.AbstractBaseGraph {
equals(obj) {
return this.isDirected() == obj.isDirected()
&& Sets_1.Sets.equals(this.nodes(), obj.nodes())
&& Sets_1.Sets.equals(this.edges(), obj.edges());
}
/** Returns a string representation of this graph. */
toString() {
return "isDirected: "
+ this.isDirected()
+ ", allowsSelfLoops: "
+ this.allowsSelfLoops()
+ ", nodes: "
+ this.nodes()
+ ", edges: "
+ this.edges();
}
}
exports.AbstractGraph = AbstractGraph;
//# sourceMappingURL=AbstractGraph.js.map