|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectagg.xt_basis.TypeImpl
public class TypeImpl
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 |
---|
protected TypeImpl()
protected TypeImpl(java.lang.String stringRepr)
stringRepr
- the name of the typeprotected TypeImpl(AttrType at, java.lang.String stringRepr)
at
- the declaration of the attributesstringRepr
- the name of the typeprotected TypeImpl(AttrType at)
at
- the declaration of the attributesMethod Detail |
---|
public void dispose()
public void finalize()
finalize
in class java.lang.Object
public void createAttributeType()
public void setAttributeType(AttrType at)
public boolean isNodeType()
isNodeType
in interface Type
public boolean isArcType()
isArcType
in interface Type
public java.lang.String convertToKey()
this.getStringRepr()+this.getAdditionalRepr()
convertToKey
in interface Type
getStringRepr()
and getAdditionalRepr()
protected void adaptTypeAttribute(Type type)
protected void checkDoubleAttributeType()
public boolean compareTo(Type t)
compareTo
in interface Type
public boolean differentTo(Type t, java.util.Vector<java.lang.String> difference)
public void setAbstract(boolean b)
setAbstract
in interface Type
public boolean isAbstract()
isAbstract
in interface Type
public boolean isChildOf(Type t)
isChildOf
in interface Type
public boolean isParentOf(Type t)
isParentOf
in interface Type
public boolean isRelatedTo(Type t)
isRelatedTo
in interface Type
public java.util.List<Type> getCommonParentWith(Type t)
getCommonParentWith
in interface Type
public java.util.Vector<Type> getAllParents()
getAllParents
in interface Type
public java.util.Vector<Type> getAllChildren()
getAllChildren
in interface Type
public int getMaxMultiplicityOfAllChildren()
public int getMinMultiplicityOfAllChildren()
public void showRelatives()
public void showAllRelatives()
public final java.lang.String getStringRepr()
getStringRepr
in interface Type
public final void setStringRepr(java.lang.String n)
setStringRepr
in interface Type
public void setTextualComment(java.lang.String text)
setTextualComment
in interface Type
public java.lang.String getTextualComment()
getTextualComment
in interface Type
public Type getParent()
getParent
in interface Type
public java.util.Vector<Type> getParents()
getParents
in interface Type
public void setParent(Type t)
setParent
in interface Type
public void addParent(Type t)
addParent
in interface Type
protected void addChild(TypeImpl t)
public java.util.Vector<Type> getChildren()
getChildren
in interface Type
public java.util.Vector<java.lang.String> checkDoubleAttributeName(Type otherType)
public void removeParent(Type t)
removeParent
in interface Type
protected void removeChild(Type t)
public boolean hasInheritedAttribute()
public final AttrType getAttrType()
getAttrType
in interface Type
public java.lang.String getAdditionalRepr()
getAdditionalRepr
in interface Type
setAdditionalRepr(java.lang.String)
public java.lang.String getImageFilename()
getImageFilename
in interface Type
public void setImageFilename(java.lang.String imageFilename)
setImageFilename
in interface Type
public void setAdditionalRepr(java.lang.String repr)
setAdditionalRepr
in interface Type
public void XwriteObject(XMLHelper h)
XwriteObject
in interface XMLObject
public void XreadObject(XMLHelper h)
XreadObject
in interface XMLObject
public java.lang.String getName()
getStringRepr()
)
getName
in interface Type
public TypeError check(GraphObject nodeOrArc, int level)
check
in interface Type
nodeOrArc
- the object to testlevel
- a type graph check level, as defined in
TypeSet.setLevelOfTypeGraphCheck(int)
TypeError
if there was a mismatchpublic TypeError check(Node node, int level)
TypeError
if there was a mismatchpublic boolean hasTypeGraphArc(Type sourceType)
public java.util.Vector<Type> getTargetsOfArc(Type sourceType)
public boolean isEdgeCreatable(Type sourceType, Type targetType, int level)
public TypeError check(Arc arc, int level)
TypeError
if there was a mismatchpublic TypeError checkIfEdgeCreatable(Node src, Node tar, int level)
public TypeError checkIfEdgeCreatable(Graph g, Node src, Node tar, int level)
protected TypeError checkSourceMax(Graph g, Node src, Node tar)
protected TypeError checkTargetMax(Graph g, Node src, Node tar)
public boolean addTypeGraphObject(GraphObject nodeOrArc)
addTypeGraphObject
in interface Type
public boolean removeTypeGraphObject(GraphObject nodeOrArc, boolean forceToRemove)
removeTypeGraphObject
in interface Type
public boolean removeTypeGraphObject(GraphObject nodeOrArc)
removeTypeGraphObject
in interface Type
public void removeAllTypeGraphObjects()
removeAllTypeGraphObjects
in interface Type
public java.util.Vector<GraphObject> getUsingGraphObjects()
getTypeUsers()
public java.util.Vector<GraphObject> getTypeUsers()
getTypeUsers
in interface Type
public void addUsingGraphObject(GraphObject nodeOrArc)
addUsingGraphObject
in interface Type
public void addTypeUser(GraphObject nodeOrArc)
addTypeUser
in interface Type
nodeOrArc
- public void addUsingGraphObject(GraphObject nodeOrArc, Graph g)
addUsingGraphObject
in interface Type
protected void addUser(Node node)
node
- protected void removeUser(Node node)
node
- protected void addUser(Arc arc)
arc
- protected void removeUser(Arc arc)
arc
- public void addTypeUser(GraphObject nodeOrArc, Graph g)
addTypeUser
in interface Type
nodeOrArc
- g
- is the context graph of the nodeOrArcpublic void removeUsingGraphObject(GraphObject nodeOrArc)
removeUsingGraphObject
in interface Type
public void removeTypeUser(GraphObject nodeOrArc)
removeTypeUser
in interface Type
nodeOrArc
- public void removeTypeUser(Node node)
public void removeTypeUser(Arc arc)
public void setSourceMin(Type sourceType, Type targetType, int value)
setSourceMin
in interface Type
public void setSourceMax(Type sourceType, Type targetType, int value)
setSourceMax
in interface Type
public void setTargetMin(Type sourceType, Type targetType, int value)
setTargetMin
in interface Type
public void setTargetMax(Type sourceType, Type targetType, int value)
setTargetMax
in interface Type
public int getSourceMin(Type sourceType, Type targetType)
getSourceMin
in interface Type
public int getSourceMax(Type sourceType, Type targetType)
getSourceMax
in interface Type
public int getTargetMin(Type sourceType, Type targetType)
getTargetMin
in interface Type
public int getTargetMax(Type sourceType, Type targetType)
getTargetMax
in interface Type
public void setSourceMin(int value)
setSourceMin
in interface Type
public void setSourceMax(int value)
setSourceMax
in interface Type
public int getSourceMin()
getSourceMin
in interface Type
public int getSourceMax()
getSourceMax
in interface Type
public void setVisibityOfObjectsOfTypeGraphArc(Type sourceType, Type targetType, boolean vis)
setVisibityOfObjectsOfTypeGraphArc
in interface Type
public boolean isObjectOfTypeGraphArcVisible(Type sourceType, Type targetType)
isObjectOfTypeGraphArcVisible
in interface Type
public Arc getTypeGraphArcObject(Type sourceType, Type targetType)
Type
getTypeGraphArcObject
in interface Type
protected agg.xt_basis.TypeGraphArc getTypeGraphArc(Type sourceType, Type targetType)
protected agg.xt_basis.TypeGraphArc getSimilarTypeGraphArc(Type sourceType, Type targetType)
public boolean hasTypeGraphArc()
hasTypeGraphArc
in interface Type
public boolean hasTypeGraphArc(Type sourceType, Type targetType)
public boolean hasTypeGraphArc(GraphObject sourceType, GraphObject targetType)
protected java.util.HashMap<Type,java.util.HashMap<Type,agg.xt_basis.TypeGraphArc>> getArcTypeGraphObjects()
public boolean compareTypeGraphArcs(Type t)
public boolean compareTypeGraphArcsMultiplicity(Type t)
public void setVisibilityOfObjectsOfTypeGraphNode(boolean vis)
setVisibilityOfObjectsOfTypeGraphNode
in interface Type
public boolean isObjectOfTypeGraphNodeVisible()
isObjectOfTypeGraphNodeVisible
in interface Type
protected agg.xt_basis.TypeGraphNode getTypeGraphNode()
public boolean hasTypeGraphNode()
hasTypeGraphNode
in interface Type
public boolean isTypeGraphNodeUsed()
public boolean isChildTypeGraphNodeUsed()
public boolean isTypeGraphArcUsed(Arc arc)
public boolean isTypeUsed()
public boolean isChildTypeUsed()
public Node getTypeGraphNodeObject()
getTypeGraphNodeObject
in interface Type
public java.util.Vector<Type> getOwnOutgoingArcTypes()
public java.util.Vector<Type> getOutgoingArcTypes()
public java.util.Vector<Arc> getOwnOutgoingArcs()
public java.util.Vector<Arc> getOutgoingArcs()
public java.util.Vector<Type> getOwnIncomingArcTypes()
public java.util.Vector<Type> getIncomingArcTypes()
public java.util.Vector<Arc> getOwnIncomingArcs()
public java.util.Vector<Arc> getIncomingArcs()
public boolean isTypeGraphObjectDefined()
isTypeGraphObjectDefined
in interface Type
public TypeError checkIfRemovableFromSource(GraphObject node, Arc arc, int level)
Type
checkIfRemovableFromSource
in interface Type
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 removedlevel
- the actual level. If not set to
TypeSet.ENABLED_MAX_MIN
this method will do nothing.
TypeError
containing the possible fault.public TypeError checkIfRemovableFromTarget(GraphObject node, Arc arc, int level)
Type
checkIfRemovableFromTarget
in interface Type
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 removedlevel
- the actual level. If not set to
TypeSet.ENABLED_MAX_MIN
this method will do nothing.
TypeError
containing the possible fault.public TypeError checkIfRemovable(Node node, int level)
checkIfRemovable
in interface Type
node
- the node which will be removed.level
- the actual level. If not set to
TypeSet.ENABLED_MAX_MIN
this method will do nothing.
TypeError
containing the possible fault.public TypeError checkIfNodeCreatable(Graph g, int level)
checkIfNodeCreatable
in interface Type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |