mapss.dif.graph.hierarchy
Class CyclicHierarchyException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by mapss.dif.graph.hierarchy.HierarchyException
                  extended by mapss.dif.graph.hierarchy.CyclicHierarchyException
All Implemented Interfaces:
java.io.Serializable

public class CyclicHierarchyException
extends HierarchyException

This exception is thrown when a cycle in the hierarchy of graphs is detected.

Version:
$Id: CyclicHierarchyException.java 409 2007-05-13 19:47:16Z plishker $
Author:
Fuat Keceli
See Also:
Hierarchy, Serialized Form

Constructor Summary
CyclicHierarchyException(mocgraph.Edge violation)
          Constructs a Cyclic Hierarchy Exception detected upon encountering a hierarchy relation (defined in the parameter) between two Hierarchy objects.
 
Method Summary
static CyclicHierarchyException checkCycle(Hierarchy parent, Hierarchy child)
          Returns a Cyclic Hierarchy Exception if a hierarchy relation cycle occurs when the child is added to parent via Hierarchy.addSuperNode(mocgraph.Node, mapss.dif.graph.hierarchy.Hierarchy).
 mocgraph.Edge getViolatingEdge()
          Returns an edge which is detected to cause a cycle during the traversal of the graph hierarchy.
 
Methods inherited from class mapss.dif.graph.hierarchy.HierarchyException
checkConnection, checkConnection, checkFlatten, checkPort, checkSuperNode
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CyclicHierarchyException

public CyclicHierarchyException(mocgraph.Edge violation)
Constructs a Cyclic Hierarchy Exception detected upon encountering a hierarchy relation (defined in the parameter) between two Hierarchy objects.

Parameters:
violation - An edge in the hierarchy relation graph which violates the DAG property. The weights of the nodes connected to the edge should be graphs. The direction of the edge should be from the parent to the child.
Method Detail

checkCycle

public static CyclicHierarchyException checkCycle(Hierarchy parent,
                                                  Hierarchy child)
Returns a Cyclic Hierarchy Exception if a hierarchy relation cycle occurs when the child is added to parent via Hierarchy.addSuperNode(mocgraph.Node, mapss.dif.graph.hierarchy.Hierarchy).

Parameters:
parent - Parent hierarchy that will include the child in a super node.
child - The sub-hierarchy.
Returns:
A CyclicHierarchyException object that can be thrown if a cycle is detected. Null otherwise.

getViolatingEdge

public mocgraph.Edge getViolatingEdge()
Returns an edge which is detected to cause a cycle during the traversal of the graph hierarchy. The weights of the nodes connected to the edge are graphs. The direction of the edge is from the parent to the child.

Returns:
A violating edge in the DAG representation of graph hierarchy.