|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>JSDoc: Source: edge.js</title> |
| 6 | + |
| 7 | + <script src="scripts/prettify/prettify.js"> </script> |
| 8 | + <script src="scripts/prettify/lang-css.js"> </script> |
| 9 | + <!--[if lt IE 9]> |
| 10 | + <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
| 11 | + <![endif]--> |
| 12 | + <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> |
| 13 | + <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> |
| 14 | +</head> |
| 15 | + |
| 16 | +<body> |
| 17 | + |
| 18 | +<div id="main"> |
| 19 | + |
| 20 | + <h1 class="page-title">Source: edge.js</h1> |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + <section> |
| 28 | + <article> |
| 29 | + <pre class="prettyprint source linenums"><code>"use strict"; |
| 30 | +/** |
| 31 | + * An edge connecting two nodes. |
| 32 | + */ |
| 33 | +class Edge { |
| 34 | + /** |
| 35 | + * Builds an Edge object. |
| 36 | + * @constructor |
| 37 | + * @param {Node} srcNode - Source node of the edge. |
| 38 | + * @param {string} relation - Relationship type of the edge. |
| 39 | + * @param {Node} destNode - Destination node of the edge. |
| 40 | + * @param {Map} properties - Properties map of the edge. |
| 41 | + */ |
| 42 | + constructor(srcNode, relation, destNode, properties) { |
| 43 | + this.id = undefined; //edge's id - set by RedisGraph |
| 44 | + this.relation = relation; //edge's relationship type |
| 45 | + this.srcNode = srcNode; //edge's source node |
| 46 | + this.destNode = destNode; //edge's destination node |
| 47 | + this.properties = properties; //edge's list of properties (list of Key:Value) |
| 48 | + } |
| 49 | + |
| 50 | + /** |
| 51 | + * Sets the edge ID. |
| 52 | + * @param {int} id |
| 53 | + */ |
| 54 | + setId(id) { |
| 55 | + this.id = id; |
| 56 | + } |
| 57 | + |
| 58 | + /** |
| 59 | + * @returns The string representation of the edge. |
| 60 | + */ |
| 61 | + toString() { |
| 62 | + return JSON.stringify(this); |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | +module.exports = Edge; |
| 67 | +</code></pre> |
| 68 | + </article> |
| 69 | + </section> |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +</div> |
| 75 | + |
| 76 | +<nav> |
| 77 | + <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Edge.html">Edge</a></li><li><a href="Graph.html">Graph</a></li><li><a href="Node.html">Node</a></li><li><a href="Path.html">Path</a></li><li><a href="Record.html">Record</a></li><li><a href="ResultSet.html">ResultSet</a></li><li><a href="Statistics.html">Statistics</a></li></ul><h3>Global</h3><ul><li><a href="global.html#Label">Label</a></li></ul> |
| 78 | +</nav> |
| 79 | + |
| 80 | +<br class="clear"> |
| 81 | + |
| 82 | +<footer> |
| 83 | + Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Dec 31 2019 12:04:12 GMT+0000 (Coordinated Universal Time) |
| 84 | +</footer> |
| 85 | + |
| 86 | +<script> prettyPrint(); </script> |
| 87 | +<script src="scripts/linenumber.js"> </script> |
| 88 | +</body> |
| 89 | +</html> |
0 commit comments