js/graph/abstractGraph.js
/**
 * The constructor for this abstract class will typically be invoked by concrete
 * sub-classes
 * 
 * @classdesc
 * 
 * <p>
 * An AbstractGraph contains the hosts and {@link AbstractNode}s that makes up
 * the model.
 * </p>
 * 
 * <p>
 * An AbstractGraph can be thought of as a set of augmented linked-lists. Each
 * host is associated with a linked-list that is "augmented" in the sense that
 * nodes can also be connected to nodes in other linked lists. The first and
 * last nodes in each linked list are dummy head and tail nodes respectively.
 * </p>
 * 
 * <p>
 * Traversing an AbstractGraph is much like traversing a linked list. For
 * example, to visit all nodes whose host is equal to "loadBalancer":
 * 
 * <pre>
 * var currentNode = this.getHeadByHost('loadBalancer').getNext();
 * while (!currentNode.isTail()) {
 *     // do something to currentNode
 *     currentNode = currentNode.getNext();
 * }
 * </pre>
 * 
 * </p>
 * 
 * <p>
 * The AbstractGraph class makes the following guarantees about nodes in the
 * graph:
 * <li>node.getNext() == null if and only if node.isTail() == true</li>
 * <li>node.getPrev() == null if and only if node.isHead() == true</li>
 * </p>
 * 
 * <p>
 * AbstractGraph implements the
 * {@link http://en.wikipedia.org/wiki/Observer_pattern observer pattern}.
 * AbstractGraph will notify registered observers when certain events happen
 * such as the removal of a node, the addition of edges between nodes, removal
 * of a host, etc.
 * </p>
 * 
 * @constructor
 * @abstract
 */
The constructor for this abstract class will typically be invoked by concrete
sub-classes

@classdesc


An AbstractGraph contains the hosts and  AbstractNodes that makes up
the model.


An AbstractGraph can be thought of as a set of augmented linked-lists. Each
host is associated with a linked-list that is "augmented" in the sense that
nodes can also be connected to nodes in other linked lists. The first and
last nodes in each linked list are dummy head and tail nodes respectively.


Traversing an AbstractGraph is much like traversing a linked list. For
example, to visit all nodes whose host is equal to "loadBalancer".









@constructor
@abstract
The constructor for this abstract class will typically be invoked by concrete sub - classes @classdesc An AbstractGraph contains the hosts and AbstractNodes that makes up the model . An AbstractGraph can be thought of as a set of augmented linked - lists . Each host is associated with a linked - list that is " augmented " in the sense that nodes can also be connected to nodes in other linked lists . The first and last nodes in each linked list are dummy head and tail nodes respectively . Traversing an AbstractGraph is much like traversing a linked list . For example to visit all nodes whose host is equal to " loadBalancer " . @constructor @abstract
function AbstractGraph() {
    if (this.constructor == AbstractGraph) {
        throw new Exception("Cannot instantiate AbstractGraph; AbstractGraph is an abstract class");
    }
    this.hosts = [];
    this.hostToHead = {};
    this.hostToTail = {};
    this.observers = {};
    for (var i = 0; i < AbstractGraph.validEvents.length; i++) {
        this.observers[AbstractGraph.validEvents[i]] = {};
    }
}
function AbstractGraph ( ) { if ( this . constructor == AbstractGraph ) { throw new Exception ( "Cannot instantiate AbstractGraph; AbstractGraph is an abstract class" ) ; } this . hosts = [ ] ; this . hostToHead = { } ; this . hostToTail = { } ; this . observers = { } ; for ( var i = 0 ; i < AbstractGraph . validEvents . length ; i ++ ) { this . observers [ AbstractGraph . validEvents [ i ] ] = { } ; } }
The constructor for this abstract class will typically be invoked by concrete
 sub-classes
The constructor for this abstract class will typically be invoked by concrete sub - classes
/** @private */ // Dictionaries linking the host name to the head/tail node for that host /** @private */ /** @private */ /** @private */