agg.xt_basis
Class TypeImpl

java.lang.Object
  extended by agg.xt_basis.TypeImpl
All Implemented Interfaces:
XMLObject, Type
Direct Known Subclasses:
ArcTypeImpl, NodeTypeImpl

public class TypeImpl
extends java.lang.Object
implements Type

The type of a graph object is here defined. Each graph object has a type. Types can be used for nodes as well as for edges. Even if there is no protection in the methods a node type should be used only for nodes and a edge type should be only used for edges.


Field Summary
 
Fields inherited from interface agg.xt_basis.Type
UNDEFINED
 
Constructor Summary
protected TypeImpl()
           
protected TypeImpl(AttrType at)
          creates a new type with the given attributes and an empty name.
protected TypeImpl(AttrType at, java.lang.String stringRepr)
          Creates a new type with the given attributes and the given name.
protected TypeImpl(java.lang.String stringRepr)
          Creates a new type with the given name.
 
Method Summary
protected  void adaptTypeAttribute(Type type)
          Adds those attribute members of the specified Type type which are not found in this type.
protected  void addChild(TypeImpl t)
           
 void addParent(Type t)
          Adds a new parent to my parent list.
 boolean addTypeGraphObject(GraphObject nodeOrArc)
          Add the given GraphObject of a type graph to this type.
 void addTypeUser(GraphObject nodeOrArc)
          Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.
 void addTypeUser(GraphObject nodeOrArc, Graph g)
          Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.
protected  void addUser(Arc arc)
          Add the specified arc to my container of graph objects.
protected  void addUser(Node node)
          Add the specified node to my container of graph objects.
 void addUsingGraphObject(GraphObject nodeOrArc)
          Deprecated. replaced by addTypeUser(GraphObject nodeOrArc)
 void addUsingGraphObject(GraphObject nodeOrArc, Graph g)
          Deprecated. replaced by addTypeUser(GraphObject nodeOrArc, Graph g)
 TypeError check(Arc arc, int level)
          Returns null, if the specified arc is valid typed as defined in the type graph.
 TypeError check(GraphObject nodeOrArc, int level)
          returns if the given GraphObject is valid typed as defined in the type graph.
 TypeError check(Node node, int level)
          returns if the given Node is valid typed as defined in the type graph.
 java.util.Vector<java.lang.String> checkDoubleAttributeName(Type otherType)
           
protected  void checkDoubleAttributeType()
           
 TypeError checkIfEdgeCreatable(Graph g, Node src, Node tar, int level)
           
 TypeError checkIfEdgeCreatable(Node src, Node tar, int level)
           
 TypeError checkIfNodeCreatable(Graph g, int level)
          This type must be a node type.
 TypeError checkIfRemovable(Node node, int level)
          The spcified node must be an instance of my.
 TypeError checkIfRemovableFromSource(GraphObject node, Arc arc, int level)
          returns if the given arc could be removed from the given node so the node would be valid typed.
 TypeError checkIfRemovableFromTarget(GraphObject node, Arc arc, int level)
          returns if the given arc could be removed from the given node so the node would be valid typed.
protected  TypeError checkSourceMax(Graph g, Node src, Node tar)
           
protected  TypeError checkTargetMax(Graph g, Node src, Node tar)
           
 boolean compareTo(Type t)
          Returns TRUE if this type is equal to the type t.
 boolean compareTypeGraphArcs(Type t)
           
 boolean compareTypeGraphArcsMultiplicity(Type t)
           
 java.lang.String convertToKey()
          Returns result string of this.getStringRepr()+this.getAdditionalRepr()
 void createAttributeType()
           
 boolean differentTo(Type t, java.util.Vector<java.lang.String> difference)
          Returns TRUE if this type is different to the type t.
 void dispose()
           
 void finalize()
           
 java.lang.String getAdditionalRepr()
          Returns the additional representation string
 java.util.Vector<Type> getAllChildren()
          returns a list with all the children of the current type and itself as the first element
 java.util.Vector<Type> getAllParents()
          returns a list with all the parents of the current type and itself as the first element
protected  java.util.HashMap<Type,java.util.HashMap<Type,agg.xt_basis.TypeGraphArc>> getArcTypeGraphObjects()
           
 AttrType getAttrType()
          Returns the associated attribute type.
 java.util.Vector<Type> getChildren()
          Returns its direct children only.
 java.util.List<Type> getCommonParentWith(Type t)
           
 java.lang.String getImageFilename()
           
 java.util.Vector<Arc> getIncomingArcs()
          Returns all incoming arcs (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.
 java.util.Vector<Type> getIncomingArcTypes()
          Returns all incoming arc types (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.
 int getMaxMultiplicityOfAllChildren()
           
 int getMinMultiplicityOfAllChildren()
           
 java.lang.String getName()
          internal function to convert a type into a string.
 java.util.Vector<Arc> getOutgoingArcs()
          Returns all outgoing arcs (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.
 java.util.Vector<Type> getOutgoingArcTypes()
          Returns all outgoing arc types (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.
 java.util.Vector<Arc> getOwnIncomingArcs()
          Returns my own incoming arcs on condition that a type graph is defined, otherwise returns an empty vector.
 java.util.Vector<Type> getOwnIncomingArcTypes()
          Returns my own incoming arc types on condition that a type graph is defined, otherwise returns an empty vector.
 java.util.Vector<Arc> getOwnOutgoingArcs()
          Returns my own outgoing arcs on condition that a type graph is defined, otherwise returns an empty vector.
 java.util.Vector<Type> getOwnOutgoingArcTypes()
          Returns my own outgoing arc types on condition that a type graph is defined, otherwise returns an empty vector.
 Type getParent()
          Returns my last direct parent.
 java.util.Vector<Type> getParents()
          Returns my all direct parents.
protected  agg.xt_basis.TypeGraphArc getSimilarTypeGraphArc(Type sourceType, Type targetType)
           
 int getSourceMax()
          Return the max of the multiplicity of a node type.
 int getSourceMax(Type sourceType, Type targetType)
          Return the max of the source multiplicity of an edge type.
 int getSourceMin()
          Return the min of the multiplicity of a node type.
 int getSourceMin(Type sourceType, Type targetType)
          Return the min of the source multiplicity of an edge type.
 java.lang.String getStringRepr()
          Returns the string representation.
 int getTargetMax(Type sourceType, Type targetType)
          Return the max of the target multiplicity of an edge type.
 int getTargetMin(Type sourceType, Type targetType)
          Return the min of the target multiplicity of an edge type.
 java.util.Vector<Type> getTargetsOfArc(Type sourceType)
          Searchs for a type that is the target type of this edge type with the specified source type.
 java.lang.String getTextualComment()
          Return textual comments of this type.
protected  agg.xt_basis.TypeGraphArc getTypeGraphArc(Type sourceType, Type targetType)
          Returns the subtype object for this source and target combination.
 Arc getTypeGraphArcObject(Type sourceType, Type targetType)
          returns a type graph edge, if it is defined.
protected  agg.xt_basis.TypeGraphNode getTypeGraphNode()
          Returns the subtype object for this node type.
 Node getTypeGraphNodeObject()
          returns the type graph node, if it is defined.
 java.util.Vector<GraphObject> getTypeUsers()
           
 java.util.Vector<GraphObject> getUsingGraphObjects()
          Deprecated. replaced by getTypeUsers()
 boolean hasInheritedAttribute()
           
 boolean hasTypeGraphArc()
           
 boolean hasTypeGraphArc(GraphObject sourceType, GraphObject targetType)
           
 boolean hasTypeGraphArc(Type sourceType)
          Returns true if at least one edge exists from the specified source type to any other type, otherwise false.
 boolean hasTypeGraphArc(Type sourceType, Type targetType)
           
 boolean hasTypeGraphNode()
          returns true, if there is an object in the type graph for this type.
 boolean isAbstract()
           
 boolean isArcType()
           
 boolean isChildOf(Type t)
          compares the specified type with parents of this object
 boolean isChildTypeGraphNodeUsed()
           
 boolean isChildTypeUsed()
           
 boolean isEdgeCreatable(Type sourceType, Type targetType, int level)
           
 boolean isNodeType()
           
 boolean isObjectOfTypeGraphArcVisible(Type sourceType, Type targetType)
           
 boolean isObjectOfTypeGraphNodeVisible()
           
 boolean isParentOf(Type t)
          compares the given type and its ancestors with this object
 boolean isRelatedTo(Type t)
          Finds out if there is any relation between this type and the given one.
 boolean isTypeGraphArcUsed(Arc arc)
           
 boolean isTypeGraphNodeUsed()
           
 boolean isTypeGraphObjectDefined()
          returns true, if there is at least one object in the type graph for this type.
 boolean isTypeUsed()
           
 void removeAllTypeGraphObjects()
          Remove type graph objects from this type.
protected  void removeChild(Type t)
           
 void removeParent(Type t)
          Removes this parent from my parent list.
 boolean removeTypeGraphObject(GraphObject nodeOrArc)
          Remove the given GraphObject from the type graph and from this type.
 boolean removeTypeGraphObject(GraphObject nodeOrArc, boolean forceToRemove)
          Remove the given GraphObject from the type graph and from this type.
 void removeTypeUser(Arc arc)
           
 void removeTypeUser(GraphObject nodeOrArc)
          Remove the specified GraphObject nodeOrArc: in case of Node - from my TypeGraphNode and in case of Arc - from my TypeGraphArc of a TypeGraph, if it exists.
 void removeTypeUser(Node node)
           
protected  void removeUser(Arc arc)
          Remove the specified arc from my container of graph objects.
protected  void removeUser(Node node)
          Remove the specified node from my container of graph objects.
 void removeUsingGraphObject(GraphObject nodeOrArc)
          Deprecated. replaced by removeTypeUser(GraphObject nodeOrArc)
 void setAbstract(boolean b)
           
 void setAdditionalRepr(java.lang.String repr)
          Set its additional graphical representation, which is always saved together with its name.
 void setAttributeType(AttrType at)
           
 void setImageFilename(java.lang.String imageFilename)
           
 void setParent(Type t)
          Remove my direct parent and set it to a new parent t.
 void setSourceMax(int value)
          Set the max of the multiplicity of a node type to the value.
 void setSourceMax(Type sourceType, Type targetType, int value)
          Set the max of the source multiplicity of an edge type to the value.
 void setSourceMin(int value)
          Set the min of the multiplicity of a node type to the value.
 void setSourceMin(Type sourceType, Type targetType, int value)
          Set the min of the source multiplicity of an edge type to the value.
 void setStringRepr(java.lang.String n)
          Sets the string representation.
 void setTargetMax(Type sourceType, Type targetType, int value)
          Set the max of the target multiplicity of an edge type to the value.
 void setTargetMin(Type sourceType, Type targetType, int value)
          Set the min of the target multiplicity of an edge type to the value.
 void setTextualComment(java.lang.String text)
          Set textual comments for this type.
 void setVisibilityOfObjectsOfTypeGraphNode(boolean vis)
           
 void setVisibityOfObjectsOfTypeGraphArc(Type sourceType, Type targetType, boolean vis)
           
 void showAllRelatives()
           
 void showRelatives()
           
 void XreadObject(XMLHelper h)
           
 void XwriteObject(XMLHelper h)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeImpl

protected TypeImpl()

TypeImpl

protected TypeImpl(java.lang.String stringRepr)
Creates a new type with the given name. There is non-attributable type.

Parameters:
stringRepr - the name of the type

TypeImpl

protected TypeImpl(AttrType at,
                   java.lang.String stringRepr)
Creates a new type with the given attributes and the given name.

Parameters:
at - the declaration of the attributes
stringRepr - the name of the type

TypeImpl

protected TypeImpl(AttrType at)
creates a new type with the given attributes and an empty name.

Parameters:
at - the declaration of the attributes
Method Detail

dispose

public void dispose()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

createAttributeType

public void createAttributeType()

setAttributeType

public void setAttributeType(AttrType at)

isNodeType

public boolean isNodeType()
Specified by:
isNodeType in interface Type

isArcType

public boolean isArcType()
Specified by:
isArcType in interface Type

convertToKey

public java.lang.String convertToKey()
Returns result string of this.getStringRepr()+this.getAdditionalRepr()

Specified by:
convertToKey in interface Type
See Also:
getStringRepr() and getAdditionalRepr()

adaptTypeAttribute

protected void adaptTypeAttribute(Type type)
Adds those attribute members of the specified Type type which are not found in this type. A conflict can arise when a new member and an existing member have equal names but different types. In this case the name of the existing attribute member will be extended by "?" and then the new attribute member will be added.


checkDoubleAttributeType

protected void checkDoubleAttributeType()

compareTo

public boolean compareTo(Type t)
Returns TRUE if this type is equal to the type t.

Specified by:
compareTo in interface Type
Returns:
true, if the given type has the same name, attributes and additional string

differentTo

public boolean differentTo(Type t,
                           java.util.Vector<java.lang.String> difference)
Returns TRUE if this type is different to the type t. The Vector difference will contain all found differences between the types, otherwise it is empty. This method should be used sooner for information about differences of types.


setAbstract

public void setAbstract(boolean b)
Specified by:
setAbstract in interface Type

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface Type

isChildOf

public boolean isChildOf(Type t)
compares the specified type with parents of this object

Specified by:
isChildOf in interface Type
Returns:
true, if the specified type has the same name, attributes and additional string representation like a parent of this object

isParentOf

public boolean isParentOf(Type t)
compares the given type and its ancestors with this object

Specified by:
isParentOf in interface Type
Returns:
true, if this type has the same name, attributes and additional representation as the specified type t or one of its ancestors.

isRelatedTo

public boolean isRelatedTo(Type t)
Finds out if there is any relation between this type and the given one. Two types are related if they have one common ancestor.

Specified by:
isRelatedTo in interface Type

getCommonParentWith

public java.util.List<Type> getCommonParentWith(Type t)
Specified by:
getCommonParentWith in interface Type

getAllParents

public java.util.Vector<Type> getAllParents()
returns a list with all the parents of the current type and itself as the first element

Specified by:
getAllParents in interface Type
Returns:
list of all parents

getAllChildren

public java.util.Vector<Type> getAllChildren()
returns a list with all the children of the current type and itself as the first element

Specified by:
getAllChildren in interface Type
Returns:
list of all children

getMaxMultiplicityOfAllChildren

public int getMaxMultiplicityOfAllChildren()

getMinMultiplicityOfAllChildren

public int getMinMultiplicityOfAllChildren()

showRelatives

public void showRelatives()

showAllRelatives

public void showAllRelatives()

getStringRepr

public final java.lang.String getStringRepr()
Returns the string representation. Mostly used as the name of a type.

Specified by:
getStringRepr in interface Type

setStringRepr

public final void setStringRepr(java.lang.String n)
Sets the string representation. Mostly used as the name of the type

Specified by:
setStringRepr in interface Type

setTextualComment

public void setTextualComment(java.lang.String text)
Set textual comments for this type.

Specified by:
setTextualComment in interface Type

getTextualComment

public java.lang.String getTextualComment()
Return textual comments of this type.

Specified by:
getTextualComment in interface Type

getParent

public Type getParent()
Returns my last direct parent.

Specified by:
getParent in interface Type

getParents

public java.util.Vector<Type> getParents()
Returns my all direct parents.

Specified by:
getParents in interface Type

setParent

public void setParent(Type t)
Remove my direct parent and set it to a new parent t. Due to this method I can have only one direct parent.

Specified by:
setParent in interface Type

addParent

public void addParent(Type t)
Adds a new parent to my parent list.

Specified by:
addParent in interface Type

addChild

protected void addChild(TypeImpl t)

getChildren

public java.util.Vector<Type> getChildren()
Returns its direct children only.

Specified by:
getChildren in interface Type

checkDoubleAttributeName

public java.util.Vector<java.lang.String> checkDoubleAttributeName(Type otherType)

removeParent

public void removeParent(Type t)
Removes this parent from my parent list.

Specified by:
removeParent in interface Type

removeChild

protected void removeChild(Type t)

hasInheritedAttribute

public boolean hasInheritedAttribute()

getAttrType

public final AttrType getAttrType()
Returns the associated attribute type.

Specified by:
getAttrType in interface Type

getAdditionalRepr

public java.lang.String getAdditionalRepr()
Returns the additional representation string

Specified by:
getAdditionalRepr in interface Type
See Also:
setAdditionalRepr(java.lang.String)

getImageFilename

public java.lang.String getImageFilename()
Specified by:
getImageFilename in interface Type

setImageFilename

public void setImageFilename(java.lang.String imageFilename)
Specified by:
setImageFilename in interface Type

setAdditionalRepr

public void setAdditionalRepr(java.lang.String repr)
Set its additional graphical representation, which is always saved together with its name. Predefined minimal additional representation string of a Node - ":RECT:java.awt.Color[r=0,g=0,b=0]:[NODE]:", of an Arc - ":SOLID_LINE:java.awt.Color[r=0,g=0,b=0]:[EDGE]:".

Specified by:
setAdditionalRepr in interface Type

XwriteObject

public void XwriteObject(XMLHelper h)
Specified by:
XwriteObject in interface XMLObject

XreadObject

public void XreadObject(XMLHelper h)
Specified by:
XreadObject in interface XMLObject

getName

public java.lang.String getName()
internal function to convert a type into a string. If the type contains an empty string representation, this function will return "unnamed" otherwise the string representation of the type (getStringRepr())

Specified by:
getName in interface Type

check

public TypeError check(GraphObject nodeOrArc,
                       int level)
returns if the given GraphObject is valid typed as defined in the type graph. Before this can be checked, all edges and nodes of the type graph must be added to theire types. The given object will not tested if this is its type.

Specified by:
check in interface Type
Parameters:
nodeOrArc - the object to test
level - a type graph check level, as defined in TypeSet.setLevelOfTypeGraphCheck(int)
Returns:
null, if the graphobject is valid typed otherwise a TypeError if there was a mismatch

check

public TypeError check(Node node,
                       int level)
returns if the given Node is valid typed as defined in the type graph. Before this can be checked, all edges and nodes of the type graph must be added to their types.

Returns:
null, if the given Node is valid typed otherwise a TypeError if there was a mismatch

hasTypeGraphArc

public boolean hasTypeGraphArc(Type sourceType)
Returns true if at least one edge exists from the specified source type to any other type, otherwise false.


getTargetsOfArc

public java.util.Vector<Type> getTargetsOfArc(Type sourceType)
Searchs for a type that is the target type of this edge type with the specified source type. Returns a vector with all found target types, otherwise empty vector.


isEdgeCreatable

public boolean isEdgeCreatable(Type sourceType,
                               Type targetType,
                               int level)

check

public TypeError check(Arc arc,
                       int level)
Returns null, if the specified arc is valid typed as defined in the type graph. Before this can be checked, all edges and nodes of the type graph must be added to theire types.

Returns:
null, if the Arc is valid typed otherwise a TypeError if there was a mismatch

checkIfEdgeCreatable

public TypeError checkIfEdgeCreatable(Node src,
                                      Node tar,
                                      int level)

checkIfEdgeCreatable

public TypeError checkIfEdgeCreatable(Graph g,
                                      Node src,
                                      Node tar,
                                      int level)

checkSourceMax

protected TypeError checkSourceMax(Graph g,
                                   Node src,
                                   Node tar)

checkTargetMax

protected TypeError checkTargetMax(Graph g,
                                   Node src,
                                   Node tar)

addTypeGraphObject

public boolean addTypeGraphObject(GraphObject nodeOrArc)
Add the given GraphObject of a type graph to this type. The GraphObject nodeOrArc must be of this type: it is a Node if this is a node type, it is an Arc if this is an edge type. In case of it is a node type and a node object inside of a type graph is already exist, it should to be removed first.

Specified by:
addTypeGraphObject in interface Type
Returns:
true, if the graph object could be added.

removeTypeGraphObject

public boolean removeTypeGraphObject(GraphObject nodeOrArc,
                                     boolean forceToRemove)
Remove the given GraphObject from the type graph and from this type. Returns true if remove is done, othewise false. To remove an GraphObject is not possible when the type graph check is activated.

Specified by:
removeTypeGraphObject in interface Type

removeTypeGraphObject

public boolean removeTypeGraphObject(GraphObject nodeOrArc)
Remove the given GraphObject from the type graph and from this type. Returns true if remove is done, othewise false. To remove an GraphObject is not possible when the type graph check is activated.

Specified by:
removeTypeGraphObject in interface Type

removeAllTypeGraphObjects

public void removeAllTypeGraphObjects()
Remove type graph objects from this type.

Specified by:
removeAllTypeGraphObjects in interface Type

getUsingGraphObjects

public java.util.Vector<GraphObject> getUsingGraphObjects()
Deprecated. replaced by getTypeUsers()


getTypeUsers

public java.util.Vector<GraphObject> getTypeUsers()
Specified by:
getTypeUsers in interface Type

addUsingGraphObject

public void addUsingGraphObject(GraphObject nodeOrArc)
Deprecated. replaced by addTypeUser(GraphObject nodeOrArc)

Specified by:
addUsingGraphObject in interface Type

addTypeUser

public void addTypeUser(GraphObject nodeOrArc)
Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.

Specified by:
addTypeUser in interface Type
Parameters:
nodeOrArc -

addUsingGraphObject

public void addUsingGraphObject(GraphObject nodeOrArc,
                                Graph g)
Deprecated. replaced by addTypeUser(GraphObject nodeOrArc, Graph g)

Specified by:
addUsingGraphObject in interface Type

addUser

protected void addUser(Node node)
Add the specified node to my container of graph objects.

Parameters:
node -

removeUser

protected void removeUser(Node node)
Remove the specified node from my container of graph objects.

Parameters:
node -

addUser

protected void addUser(Arc arc)
Add the specified arc to my container of graph objects.

Parameters:
arc -

removeUser

protected void removeUser(Arc arc)
Remove the specified arc from my container of graph objects.

Parameters:
arc -

addTypeUser

public void addTypeUser(GraphObject nodeOrArc,
                        Graph g)
Add the specified GraphObject nodeOrArc: in case of Node - to my TypeGraphNode and in case of Arc - to my TypeGraphArc of a TypeGraph, if it exists.

Specified by:
addTypeUser in interface Type
Parameters:
nodeOrArc -
g - is the context graph of the nodeOrArc

removeUsingGraphObject

public void removeUsingGraphObject(GraphObject nodeOrArc)
Deprecated. replaced by removeTypeUser(GraphObject nodeOrArc)

Specified by:
removeUsingGraphObject in interface Type

removeTypeUser

public void removeTypeUser(GraphObject nodeOrArc)
Remove the specified GraphObject nodeOrArc: in case of Node - from my TypeGraphNode and in case of Arc - from my TypeGraphArc of a TypeGraph, if it exists.

Specified by:
removeTypeUser in interface Type
Parameters:
nodeOrArc -

removeTypeUser

public void removeTypeUser(Node node)

removeTypeUser

public void removeTypeUser(Arc arc)

setSourceMin

public void setSourceMin(Type sourceType,
                         Type targetType,
                         int value)
Set the min of the source multiplicity of an edge type to the value. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
setSourceMin in interface Type

setSourceMax

public void setSourceMax(Type sourceType,
                         Type targetType,
                         int value)
Set the max of the source multiplicity of an edge type to the value. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
setSourceMax in interface Type

setTargetMin

public void setTargetMin(Type sourceType,
                         Type targetType,
                         int value)
Set the min of the target multiplicity of an edge type to the value. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
setTargetMin in interface Type

setTargetMax

public void setTargetMax(Type sourceType,
                         Type targetType,
                         int value)
Set the max of the target multiplicity of an edge type to the value. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
setTargetMax in interface Type

getSourceMin

public int getSourceMin(Type sourceType,
                        Type targetType)
Return the min of the source multiplicity of an edge type. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
getSourceMin in interface Type

getSourceMax

public int getSourceMax(Type sourceType,
                        Type targetType)
Return the max of the source multiplicity of an edge type. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
getSourceMax in interface Type

getTargetMin

public int getTargetMin(Type sourceType,
                        Type targetType)
Return the min of the target multiplicity of an edge type. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
getTargetMin in interface Type

getTargetMax

public int getTargetMax(Type sourceType,
                        Type targetType)
Return the max of the target multiplicity of an edge type. The edge type is defined throught the node type sourceType and the node type targetType.

Specified by:
getTargetMax in interface Type

setSourceMin

public void setSourceMin(int value)
Set the min of the multiplicity of a node type to the value. The node type is defined throught the sourceType .

Specified by:
setSourceMin in interface Type

setSourceMax

public void setSourceMax(int value)
Set the max of the multiplicity of a node type to the value. The node type is defined throught the sourceType .

Specified by:
setSourceMax in interface Type

getSourceMin

public int getSourceMin()
Return the min of the multiplicity of a node type. The node type is defined throught the sourceType.

Specified by:
getSourceMin in interface Type

getSourceMax

public int getSourceMax()
Return the max of the multiplicity of a node type. The node type is defined throught the sourceType.

Specified by:
getSourceMax in interface Type

setVisibityOfObjectsOfTypeGraphArc

public void setVisibityOfObjectsOfTypeGraphArc(Type sourceType,
                                               Type targetType,
                                               boolean vis)
Specified by:
setVisibityOfObjectsOfTypeGraphArc in interface Type

isObjectOfTypeGraphArcVisible

public boolean isObjectOfTypeGraphArcVisible(Type sourceType,
                                             Type targetType)
Specified by:
isObjectOfTypeGraphArcVisible in interface Type

getTypeGraphArcObject

public Arc getTypeGraphArcObject(Type sourceType,
                                 Type targetType)
Description copied from interface: Type
returns a type graph edge, if it is defined.

Specified by:
getTypeGraphArcObject in interface Type

getTypeGraphArc

protected agg.xt_basis.TypeGraphArc getTypeGraphArc(Type sourceType,
                                                    Type targetType)
Returns the subtype object for this source and target combination. The subtype will be created, if it not exists.


getSimilarTypeGraphArc

protected agg.xt_basis.TypeGraphArc getSimilarTypeGraphArc(Type sourceType,
                                                           Type targetType)

hasTypeGraphArc

public boolean hasTypeGraphArc()
Specified by:
hasTypeGraphArc in interface Type

hasTypeGraphArc

public boolean hasTypeGraphArc(Type sourceType,
                               Type targetType)

hasTypeGraphArc

public boolean hasTypeGraphArc(GraphObject sourceType,
                               GraphObject targetType)

getArcTypeGraphObjects

protected java.util.HashMap<Type,java.util.HashMap<Type,agg.xt_basis.TypeGraphArc>> getArcTypeGraphObjects()

compareTypeGraphArcs

public boolean compareTypeGraphArcs(Type t)

compareTypeGraphArcsMultiplicity

public boolean compareTypeGraphArcsMultiplicity(Type t)

setVisibilityOfObjectsOfTypeGraphNode

public void setVisibilityOfObjectsOfTypeGraphNode(boolean vis)
Specified by:
setVisibilityOfObjectsOfTypeGraphNode in interface Type

isObjectOfTypeGraphNodeVisible

public boolean isObjectOfTypeGraphNodeVisible()
Specified by:
isObjectOfTypeGraphNodeVisible in interface Type

getTypeGraphNode

protected agg.xt_basis.TypeGraphNode getTypeGraphNode()
Returns the subtype object for this node type.


hasTypeGraphNode

public boolean hasTypeGraphNode()
returns true, if there is an object in the type graph for this type.

Specified by:
hasTypeGraphNode in interface Type

isTypeGraphNodeUsed

public boolean isTypeGraphNodeUsed()

isChildTypeGraphNodeUsed

public boolean isChildTypeGraphNodeUsed()

isTypeGraphArcUsed

public boolean isTypeGraphArcUsed(Arc arc)

isTypeUsed

public boolean isTypeUsed()

isChildTypeUsed

public boolean isChildTypeUsed()

getTypeGraphNodeObject

public Node getTypeGraphNodeObject()
returns the type graph node, if it is defined.

Specified by:
getTypeGraphNodeObject in interface Type

getOwnOutgoingArcTypes

public java.util.Vector<Type> getOwnOutgoingArcTypes()
Returns my own outgoing arc types on condition that a type graph is defined, otherwise returns an empty vector.


getOutgoingArcTypes

public java.util.Vector<Type> getOutgoingArcTypes()
Returns all outgoing arc types (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.


getOwnOutgoingArcs

public java.util.Vector<Arc> getOwnOutgoingArcs()
Returns my own outgoing arcs on condition that a type graph is defined, otherwise returns an empty vector.


getOutgoingArcs

public java.util.Vector<Arc> getOutgoingArcs()
Returns all outgoing arcs (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.


getOwnIncomingArcTypes

public java.util.Vector<Type> getOwnIncomingArcTypes()
Returns my own incoming arc types on condition that a type graph is defined, otherwise returns an empty vector.


getIncomingArcTypes

public java.util.Vector<Type> getIncomingArcTypes()
Returns all incoming arc types (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.


getOwnIncomingArcs

public java.util.Vector<Arc> getOwnIncomingArcs()
Returns my own incoming arcs on condition that a type graph is defined, otherwise returns an empty vector.


getIncomingArcs

public java.util.Vector<Arc> getIncomingArcs()
Returns all incoming arcs (of my own and of my parents) on condition that a type graph is defined, otherwise returns an empty vector.


isTypeGraphObjectDefined

public boolean isTypeGraphObjectDefined()
returns true, if there is at least one object in the type graph for this type.

Specified by:
isTypeGraphObjectDefined in interface Type

checkIfRemovableFromSource

public TypeError checkIfRemovableFromSource(GraphObject node,
                                            Arc arc,
                                            int level)
Description copied from interface: Type
returns if the given arc could be removed from the given node so the node would be valid typed. This check makes only sense, if the minimum multiplicity check is activated.

Specified by:
checkIfRemovableFromSource in interface Type
Parameters:
node - the node which will be modified. This node has to be the source of the arc and has to have this type.
arc - the arc which will be removed
level - the actual level. If not set to TypeSet.ENABLED_MAX_MIN this method will do nothing.
Returns:
null, if the node will be valid typed even after removing the arc otherwise a TypeError containing the possible fault.

checkIfRemovableFromTarget

public TypeError checkIfRemovableFromTarget(GraphObject node,
                                            Arc arc,
                                            int level)
Description copied from interface: Type
returns if the given arc could be removed from the given node so the node would be valid typed. This check makes only sense, if the minimum multiplicity check is activated.

Specified by:
checkIfRemovableFromTarget in interface Type
Parameters:
node - the node which will be modified. This node has to be the target of the arc and has to have this type.
arc - the arc which will be removed
level - the actual level. If not set to TypeSet.ENABLED_MAX_MIN this method will do nothing.
Returns:
null, if the node will be valid typed even after removing the arc otherwise a TypeError containing the possible fault.

checkIfRemovable

public TypeError checkIfRemovable(Node node,
                                  int level)
The spcified node must be an instance of my.

Specified by:
checkIfRemovable in interface Type
Parameters:
node - the node which will be removed.
level - the actual level. If not set to TypeSet.ENABLED_MAX_MIN this method will do nothing.
Returns:
null, if the node will be valid typed even after removing the arc otherwise a TypeError containing the possible fault.

checkIfNodeCreatable

public TypeError checkIfNodeCreatable(Graph g,
                                      int level)
This type must be a node type. The specified Graph is not a type graph. Check the max maltiplicity of this type because a new node should be created. Returns an error if this check failed, otherwise - null.

Specified by:
checkIfNodeCreatable in interface Type