package edu.neu.ccs.demeter.aplib;

import java.util.Collection;

/** A directed graph whose nodes are unique Objects with unique String
    labels and whose edges are EdgeI objects.  For each node, the list of
    labels of construction edges going out of a node has no duplicates,
    and there are no duplicate alternation or inheritance edges.  Calling
    .toString() on a node must return the label; these invariants must hold:
        getNode(String.valueOf(v)) == v
	String.valueOf(getNode(l)) == l
    (Note that a node is allowed to be null.)  A node should also define
    .hashCode() and .equals() properly so that it may be used as a HashMap
    key. */
public interface ClassGraphI {
  /** A collection of nodes in the class graph. */
  Collection getNodes();

  /** The node labeled l in the class graph. */
  Object getNode(String l) throws NoSuchClassGraphNodeException;

  /** A collection of edges (EdgeI objects) going out of node v.  Return an
      empty collection if there are no outgoing edges. */
  Collection getOutgoingEdges(Object v) throws NoSuchClassGraphNodeException;

  /** A List of edges (EdgeI objects) coming into node v.  Return an
      empty list if there are no incoming edges. */
  Collection getIncomingEdges(Object v) throws NoSuchClassGraphNodeException;
}

