Edge¶
Overview¶
Represents a segment in the graph (connects to vertices on both ends)
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class Edge¶
Instance Methods¶
initialize( segment, startVertex, endVertex )¶
Similar to a usual constructor, but is set up so it can be called multiple times (with dispose() in-between) to support pooling. @private
@param {Segment} segment @param {Vertex} startVertex @param {Vertex} endVertex @returns {Edge} - This reference for chaining
serialize()¶
Returns an object form that can be turned back into a segment with the corresponding deserialize method. @public
@returns {Object}
dispose()¶
Removes references (so it can allow other objects to be GC'ed or pooled), and frees itself to the pool so it can be reused. @public
getOtherVertex( vertex )¶
Returns the other vertex associated with an edge. @public
@param {Vertex} vertex @returns {Vertex}
updateReferences()¶
Update possibly reversed vertex references (since they may be updated) @public