define(function () {
    "use strict";

    var Edge = function (nodes) {
        this.setNodes(nodes);
    };

    Edge.prototype.setNodes = function (nodes) {
        this._nodes = nodes;
        return this;
    };

    Edge.prototype.getNodes = function () {
        return this._nodes;
    };

    Edge.prototype.addTo = function (graph) {
        this._resolveIds(graph);
        graph.addEdge(this);
        return this;
    };

    /**
     * Replace string IDs representing nodes with node references
     * @param {G.Graph} graph - Graph to retrieve node references from IDs
     * @returns {undefined}
     * @private
     */
    Edge.prototype._resolveIds = function (graph) {
        if (typeof this._nodes[0] === "string") {
            this._nodes[0] = graph.getNode(this._nodes[0]);
        }

        if (typeof this._nodes[1] === "string") {
            this._nodes[1] = graph.getNode(this._nodes[1]);
        }
    };

    return Edge;
});

define(function () {
    "use strict";

    var Edge = function (nodes) {
        this.setNodes(nodes);
    };

    Edge.prototype.setNodes = function (nodes) {
        this._nodes = nodes;
        return this;
    };

    Edge.prototype.getNodes = function () {
        return this._nodes;
    };

    Edge.prototype.addTo = function (graph) {
        this._resolveIds(graph);
        graph.addEdge(this);
        return this;
    };

    /**
     * Replace string IDs representing nodes with node references
     * @private
     * @method
     *
     * @param {G.Graph} graph - Graph to retrieve node references from IDs
     * @returns {undefined}
     */
    Edge.prototype._resolveIds = function (graph) {
        if (typeof this._nodes[0] === "string") {
            this._nodes[0] = graph.getNode(this._nodes[0]);
        }

        if (typeof this._nodes[1] === "string") {
            this._nodes[1] = graph.getNode(this._nodes[1]);
        }
    };

    return Edge;
});

Reorganize jsdoc, add @method tag
Reorganize jsdoc, add @method tag
