agg.xt_basis
Class TypeError

java.lang.Object
  extended by agg.xt_basis.TypeError

public class TypeError
extends java.lang.Object

This object stand for an error while type checking. The TypeSet.checkTypeGraph() and TypeSet.checkType(agg.xt_basis.Graph) methods will return a Enumeration with such objects, if an error occured. From the object you can get some information about the kind of error and the wrong typed graph objects. This object will also provide a number for the error occured.


Field Summary
static int NO_SUCH_TYPE
          Error number if a graph object was found which type is not defined in the type graph (but defined in the TypeSet).
static int NO_TYPE_GRAPH
          Error number if no type graph was defined.
static int NOT_COMPATIBLE_TYPE
           
static int NOT_DEFINED
          Error number for undefined errors.
static int PARENT_NOT_ALLOWED
           
static int TO_LESS_ARCS
          Error number if there were not as many arcs of a type as allowed by the type graph.
static int TO_LESS_NODES
           
static int TO_MUCH_ARCS
          Error number if there were more arcs of a type as allowed by the type graph.
static int TO_MUCH_NODES
           
static int TYPE_ALREADY_DEFINED
          Error number if a type is already defined in the type graph (Two nodes of the same type or two edges of the same type between the same nodes).
static int TYPE_IS_IN_USE
          Error number you tried to remove a graph object from the type graph, but there are graph objects in the other graphs of this type.
static int TYPE_UNDEFINED
          Error number if a type is not present in the type graph.
static int TYPE_UNKNOWN_HERE
          Error number if you tried to merge two type sets and there are used types unknown (The merging will happening, if you use another TypeSet to check a graph).
static int UNKNOWN_ERROR
           
 
Constructor Summary
TypeError(int errorNumber, java.lang.String message)
          creates an error object.
TypeError(int errorNumber, java.lang.String message, Graph containingGraph)
          creates an error object.
TypeError(int errorNumber, java.lang.String message, GraphObject wrongObject, Type wrongType)
          creates an error object.
TypeError(int errorNumber, java.lang.String message, GraphObject wrongObject, Type wrongType, Graph containingGraph)
          creates an error object.
TypeError(int errorNumber, java.lang.String message, Type wrongType)
          creates an error object.
TypeError(int errorNumber, java.lang.String message, Type wrongType, Graph containingGraph)
          creates an error object.
 
Method Summary
 Graph getContainingGraph()
          returns the graph which was checked and which contains the errors.
 int getErrorNumber()
          returns a code for the error occured.
 GraphObject getGraphObject()
          retuns the GraphObject of error.
 java.lang.String getMessage()
          returns a short english describtion of the error.
 Type getType()
          retuns the Type of error.
 void setContainingGraph(Graph containingGraph)
          sets the graph containing the error.
 java.lang.String toString()
          returns a short string with error number and message for testing purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_DEFINED

public static final int NOT_DEFINED
Error number for undefined errors. No method in the official distribution will return this, but you can use it for testing or if your error wont fit in one of the other categories. All contained objects may be null.

See Also:
Constant Field Values

NO_TYPE_GRAPH

public static final int NO_TYPE_GRAPH
Error number if no type graph was defined. This error will occure when you try to check the type error or when you try to check some other graph with an empty type graph or no type graph. All contained objects should be null.

See Also:
Constant Field Values

TYPE_UNDEFINED

public static final int TYPE_UNDEFINED
Error number if a type is not present in the type graph. getType() will return the missing type and getContainingGraph() will return the used type graph.

See Also:
Constant Field Values

TYPE_ALREADY_DEFINED

public static final int TYPE_ALREADY_DEFINED
Error number if a type is already defined in the type graph (Two nodes of the same type or two edges of the same type between the same nodes). getType() will return the missing type, getGraphObject() will return the last found graph object with this type and getContainingGraph() will return the used type graph.

See Also:
Constant Field Values

TYPE_IS_IN_USE

public static final int TYPE_IS_IN_USE
Error number you tried to remove a graph object from the type graph, but there are graph objects in the other graphs of this type. getType() will return the type, getGraphObject() will return the graph object you tried to remove or if you tried to remove the type, getType() will return the type. getContainingGraph() will return the used type graph.

See Also:
Constant Field Values

TYPE_UNKNOWN_HERE

public static final int TYPE_UNKNOWN_HERE
Error number if you tried to merge two type sets and there are used types unknown (The merging will happening, if you use another TypeSet to check a graph). getType() will return the missing type, getGraphObject() will return the graph object using this type and getContainingGraph() will return the checked graph.

See Also:
Constant Field Values

NO_SUCH_TYPE

public static final int NO_SUCH_TYPE
Error number if a graph object was found which type is not defined in the type graph (but defined in the TypeSet). getType() will return the type, getGraphObject() will return the graph object with the wrong type and getContainingGraph() will return the checked graph.

See Also:
Constant Field Values

TO_MUCH_ARCS

public static final int TO_MUCH_ARCS
Error number if there were more arcs of a type as allowed by the type graph. getType() will return the type, getGraphObject() will return the last found graph object with this type and getContainingGraph() will return the checked graph. It is possible that more than one error object will be produced for one occurence of this mismatch (f.e. one for each arc).

See Also:
Constant Field Values

TO_LESS_ARCS

public static final int TO_LESS_ARCS
Error number if there were not as many arcs of a type as allowed by the type graph. getType() will return the type and getContainingGraph() will return the checked graph.

See Also:
Constant Field Values

TO_LESS_NODES

public static final int TO_LESS_NODES
See Also:
Constant Field Values

TO_MUCH_NODES

public static final int TO_MUCH_NODES
See Also:
Constant Field Values

PARENT_NOT_ALLOWED

public static final int PARENT_NOT_ALLOWED
See Also:
Constant Field Values

NOT_COMPATIBLE_TYPE

public static final int NOT_COMPATIBLE_TYPE
See Also:
Constant Field Values

UNKNOWN_ERROR

public static final int UNKNOWN_ERROR
See Also:
Constant Field Values
Constructor Detail

TypeError

public TypeError(int errorNumber,
                 java.lang.String message)
creates an error object. The values can not changed after creation.

Parameters:
errorNumber - a code for the error occured. As described above (see NOT_DEFINED) the code also defines which other parameters are set.
message - a short english describtion of the error. The describtion should not contain more informations as given by the errorNumber and the other parameter.
See Also:
setContainingGraph(Graph), NOT_DEFINED, NO_TYPE_GRAPH

TypeError

public TypeError(int errorNumber,
                 java.lang.String message,
                 Type wrongType)
creates an error object. The values can not changed after creation.

Parameters:
errorNumber - a code for the error occured. As described above (see NOT_DEFINED) the code also defines which other parameters are set.
message - a short english describtion of the error. The describtion should not contain more informations as given by the errorNumber and the other parameter.
wrongType - the invalid Type. Which role the Type plays is described in the comment of the error number.
See Also:
setContainingGraph(Graph), NOT_DEFINED, TYPE_UNDEFINED

TypeError

public TypeError(int errorNumber,
                 java.lang.String message,
                 GraphObject wrongObject,
                 Type wrongType)
creates an error object. The values can not changed after creation.

Parameters:
errorNumber - a code for the error occured. As described above (see NOT_DEFINED) the code also defines which other parameters are set.
message - a short english describtion of the error. The describtion should not contain more informations as given by the errorNumber and the other parameter.
wrongObject - the invalid GraphObject.
wrongType - the invalid Type. Which role the GraphObject and the Type plays is described in the comment of the error number.
See Also:
setContainingGraph(Graph), NOT_DEFINED, NO_TYPE_GRAPH, TYPE_UNDEFINED, TYPE_ALREADY_DEFINED, TYPE_UNKNOWN_HERE, NO_SUCH_TYPE, TO_MUCH_ARCS, TO_LESS_ARCS

TypeError

public TypeError(int errorNumber,
                 java.lang.String message,
                 Graph containingGraph)
creates an error object. The values can not changed after creation.

Parameters:
errorNumber - a code for the error occured. As described above (see NOT_DEFINED) the code also defines which other parameters are set.
message - a short english describtion of the error. The describtion should not contain more informations as given by the errorNumber and the other parameter.
containingGraph - the graph which contains the wrong objects.
See Also:
NOT_DEFINED, NO_TYPE_GRAPH

TypeError

public TypeError(int errorNumber,
                 java.lang.String message,
                 Type wrongType,
                 Graph containingGraph)
creates an error object. The values can not changed after creation.

Parameters:
errorNumber - a code for the error occured. As described above (see NOT_DEFINED) the code also defines which other parameters are set.
message - a short english describtion of the error. The describtion should not contain more informations as given by the errorNumber and the other parameter.
wrongType - the invalid Type. Which role the Type plays is described in the comment of the error number.
containingGraph - the graph which contains the wrong objects.
See Also:
NOT_DEFINED, TYPE_UNDEFINED

TypeError

public TypeError(int errorNumber,
                 java.lang.String message,
                 GraphObject wrongObject,
                 Type wrongType,
                 Graph containingGraph)
creates an error object. The values can not changed after creation.

Parameters:
errorNumber - a code for the error occured. As described above (see NOT_DEFINED) the code also defines which other parameters are set.
message - a short english describtion of the error. The describtion should not contain more informations as given by the errorNumber and the other parameter.
wrongObject - the invalid GraphObject.
wrongType - the invalid Type. Which role the GraphObject and the Type plays is described in the comment of the error number.
containingGraph - the graph which contains the wrong objects.
See Also:
NOT_DEFINED, NO_TYPE_GRAPH, TYPE_UNDEFINED, TYPE_ALREADY_DEFINED, TYPE_UNKNOWN_HERE, NO_SUCH_TYPE, TO_MUCH_ARCS, TO_LESS_ARCS
Method Detail

getErrorNumber

public int getErrorNumber()
returns a code for the error occured. As described above (see NOT_DEFINED) the code also defines which other parameters are set.

See Also:
NOT_DEFINED, NO_TYPE_GRAPH, TYPE_UNDEFINED, TYPE_ALREADY_DEFINED, TYPE_UNKNOWN_HERE, NO_SUCH_TYPE, TO_MUCH_ARCS, TO_LESS_ARCS

getMessage

public java.lang.String getMessage()
returns a short english describtion of the error. The describtion should not contain more informations as given by the errorNumber and the other parameter.

See Also:
getErrorNumber()

getGraphObject

public GraphObject getGraphObject()
retuns the GraphObject of error. Which role this object plays is described in the comment for the error number (see NOT_DEFINED).


getType

public Type getType()
retuns the Type of error. Which role this object plays is described in the comment for the error number (see NOT_DEFINED).


getContainingGraph

public Graph getContainingGraph()
returns the graph which was checked and which contains the errors.


setContainingGraph

public void setContainingGraph(Graph containingGraph)
sets the graph containing the error.


toString

public java.lang.String toString()
returns a short string with error number and message for testing purposes.

Overrides:
toString in class java.lang.Object