ptolemy.graph
Class GraphException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by ptolemy.graph.GraphException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GraphConstructionException, GraphElementException, GraphStateException, GraphTopologyException, GraphWeightException

public class GraphException
extends java.lang.RuntimeException

Base exception for graph errors. This is also an instance of RuntimeException.

Since:
Ptolemy II 2.1
Version:
$Id: GraphException.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Mingyung Ko, Shuvra S. Bhattacharyya
See Also:
Serialized Form
Accepted Rating:
Red (ssb)
Proposed Rating:
Red (myko)

Constructor Summary
GraphException()
          The default constructor without arguments.
GraphException(java.lang.String message)
          Constructor with an argument of text description.
 
Method Summary
protected static java.lang.String _elementDump(java.lang.Object element, Graph graph, java.lang.String elementDescriptor)
          Return a dump of an element (Node, Edge, or weight) and the container graph suitable to be appended to an error message.
static java.lang.String elementDump(Element element, Graph graph)
          Return a dump of a graph element and the container graph suitable to be appended to an error message.
static java.lang.String graphDump(Graph graph)
          Return a dump of this graph suitable to be appended to an error message.
static java.lang.String weightDump(java.lang.Object weight)
          Return a dump of a weight and the container graph suitable to be appended to an error message.
 
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

GraphException

public GraphException()
The default constructor without arguments.


GraphException

public GraphException(java.lang.String message)
Constructor with an argument of text description.

Parameters:
message - The exception message.
Method Detail

graphDump

public static java.lang.String graphDump(Graph graph)
Return a dump of this graph suitable to be appended to an error message.

Parameters:
graph - The graph to dump.
Returns:
A text string dump of the graph.

elementDump

public static java.lang.String elementDump(Element element,
                                           Graph graph)
Return a dump of a graph element and the container graph suitable to be appended to an error message.

Parameters:
element - The element to dump.
graph - The graph where the element resides.
Returns:
A text string dump of the element and graph.

weightDump

public static java.lang.String weightDump(java.lang.Object weight)
Return a dump of a weight and the container graph suitable to be appended to an error message. Generally, an elementDump(Element, Graph) follows.

Parameters:
weight - The weight to dump.
Returns:
A text string dump of the weight and graph.

_elementDump

protected static java.lang.String _elementDump(java.lang.Object element,
                                               Graph graph,
                                               java.lang.String elementDescriptor)
Return a dump of an element (Node, Edge, or weight) and the container graph suitable to be appended to an error message.

Parameters:
element - The element to dump.
graph - The container graph.
elementDescriptor - Descriptor of the element.
Returns:
A text string dump of the element and graph.