Class NESTGraphObjectImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.object.impl.DataObjectImpl
-
- de.uni_trier.wi2.procake.data.object.nest.impl.NESTGraphObjectImpl
-
- All Implemented Interfaces:
DataObject,NESTGraphObject,PropertyHandler
- Direct Known Subclasses:
NESTAbstractWorkflowObjectImpl
public class NESTGraphObjectImpl extends DataObjectImpl implements NESTGraphObject
-
-
Field Summary
Fields Modifier and Type Field Description protected List<NESTGraphListener>eventListenerStores the list of listeners for this graph objectprotected Map<String,NESTNodeObject>graphNodesStores the internal list of graph nodes in the graph.protected NESTGraphIDManageridManagerStores the ID-manager for this graph object.-
Fields inherited from class de.uni_trier.wi2.procake.data.object.impl.DataObjectImpl
objectId
-
-
Constructor Summary
Constructors Constructor Description NESTGraphObjectImpl(NESTGraphClass cakeclazz)Standard constructor of CAKE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGraphNode(NESTNodeObject newGraphNode)Adds the given graph-node to the internal list of registered graphnodes.voidassertSameValueAsIn(DataObject object)protected voidcheckAllowedGraphClasses(NESTGraphItemObject nestGraphItem)booleancontainsValueFrom(NESTGraphObject graph)Checks, whether the given graph is entirely contained in this graph.booleancontainsValueFromWithExceptions(NESTGraphObject graph)Checks, whether the given graph is entirely contained in this graph.DataObjectcopy()Makes a deep copy of the data objectNESTNodeObjectgetEqualIdGraphNode(NESTNodeObject node)Returns the graph node whose id is equal to the given node from the internal list of graphnodes.NESTEdgeObjectgetGraphEdge(String id)Returns the graph edge with the specified id.Set<NESTEdgeObject>getGraphEdges()Returns the complete list of graphedges contained in the graphNESTNodeObjectgetGraphNode(String id)Returns the graphnode with the given id from the internal list of graphnodes.Set<NESTNodeObject>getGraphNodes()Returns the complete list of graph nodes registered in the graph.Set<NESTNodeObject>getGraphNodes(Predicate<? super NESTNodeObject> filter)Returns a list of graph nodes registered in the graph.NESTGraphIDManagergetIDManager()Returns the ID-manager for this graph.NESTGraphModifiergetModifier()Returns the modifier.intgetNumberOfEdges()intgetNumberOfNodes()<T extends NESTNodeObject>
TgetSemanticallyEqualNode(T node)Returns the graph node that is identical (due to its similarity value of 1.0) to the given node from the internal list of graphnodes.<T extends NESTNodeObject>
TgetSemanticallyEqualNode(T node, SimilarityValuator simVal, String simMeasure)Returns the graph node that is identical (due to its similarity value of 1.0) to the given node from the internal list of graphnodes.NESTGraphVisualizergetVisualizer()Returns the default visualizer for this graph.NESTGraphVisualizergetVisualizer(Class clazz)booleanhasSameValueAsIn(DataObject object)This method makes a deep compare.protected voidpublishAddNode(NESTNodeObject newNode)Distributes adding a node to the listenersprotected voidpublishRemoveNode(NESTNodeObject oldNode)Distributes removing a node to the listenersbooleanremoveGraphNode(String id)Removes the given graph-node from the internal list of registered graphnodes.StringtoString()protected voidupdateDependencies(NESTNodeObject newItem)Assures that the newly added item knows about this graphobject.voidupdateGraphNodeId(String oldId, String newId)Updates the internal list of registered graphnodes, when an id of a graph node changed.-
Methods inherited from class de.uni_trier.wi2.procake.data.object.impl.DataObjectImpl
addProperty, addProperty, deepCopy, getAllProperties, getAllPropertyNodes, getDataClass, getId, getModel, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasClassName, hasProperties, hasSystemClassName, isAggregate, isAtomic, isBoolean, isByteArray, isChronologic, isCollection, isDataflowWrapper, isDataReference, isDate, isDouble, isInteger, isInterval, isKindOf, isList, isMemberOf, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isSequence, isSet, isString, isSubWorkflow, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, removeId, removeProperty, setDataClass, setId, toDetailedString, toXML
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.data.object.DataObject
getDataClass, getId, getModel, hasClassName, hasSystemClassName, isAggregate, isAtomic, isBoolean, isByteArray, isChronologic, isCollection, isDataflowWrapper, isDataReference, isDate, isDouble, isInteger, isInterval, isKindOf, isList, isMemberOf, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isSequence, isSet, isString, isSubWorkflow, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, removeId, setDataClass, setId, toDetailedString, toXML
-
Methods inherited from interface de.uni_trier.wi2.procake.data.PropertyHandler
addProperty, addProperty, getAllProperties, getAllPropertyNodes, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasProperties, removeProperty
-
-
-
-
Field Detail
-
graphNodes
protected Map<String,NESTNodeObject> graphNodes
Stores the internal list of graph nodes in the graph.
-
eventListener
protected List<NESTGraphListener> eventListener
Stores the list of listeners for this graph object
-
idManager
protected NESTGraphIDManager idManager
Stores the ID-manager for this graph object.
-
-
Constructor Detail
-
NESTGraphObjectImpl
public NESTGraphObjectImpl(NESTGraphClass cakeclazz)
Standard constructor of CAKE- Parameters:
cakeclazz-
-
-
Method Detail
-
addGraphNode
public void addGraphNode(NESTNodeObject newGraphNode)
Description copied from interface:NESTGraphObjectAdds the given graph-node to the internal list of registered graphnodes. Nodes are being bound automatically if they are connected to already bound edges. → Create the graph based on the startnode, so that all nodes/edges get automatically bound.- Specified by:
addGraphNodein interfaceNESTGraphObject- Parameters:
newGraphNode- The graphnode, which should be registered.
-
removeGraphNode
public boolean removeGraphNode(String id)
Description copied from interface:NESTGraphObjectRemoves the given graph-node from the internal list of registered graphnodes. It is important to remove unused or obsolete nodes from the internal list in order to have a consistent objectmodel.- Specified by:
removeGraphNodein interfaceNESTGraphObject- Parameters:
id- The id of the node to remove.- Returns:
- TRUE, if the removal-process was successfull. FALSE, otherwise.
-
getSemanticallyEqualNode
public <T extends NESTNodeObject> T getSemanticallyEqualNode(T node, SimilarityValuator simVal, String simMeasure)
Description copied from interface:NESTGraphObjectReturns the graph node that is identical (due to its similarity value of 1.0) to the given node from the internal list of graphnodes.- Specified by:
getSemanticallyEqualNodein interfaceNESTGraphObject- Parameters:
node- the node that is compared to the other nodes of the graphsimVal- The similarity valuator to usesimMeasure- The name of the similarity measure to use- Returns:
- semantic equal graph node, if exists
nullotherwise
-
getSemanticallyEqualNode
public <T extends NESTNodeObject> T getSemanticallyEqualNode(T node)
Description copied from interface:NESTGraphObjectReturns the graph node that is identical (due to its similarity value of 1.0) to the given node from the internal list of graphnodes. The default similarity valuator and measure are used.- Specified by:
getSemanticallyEqualNodein interfaceNESTGraphObject- Parameters:
node- the node that is compared to the other nodes of the graph- Returns:
- semantic equal graph node, if exists
nullotherwise
-
getEqualIdGraphNode
public NESTNodeObject getEqualIdGraphNode(NESTNodeObject node)
Description copied from interface:NESTGraphObjectReturns the graph node whose id is equal to the given node from the internal list of graphnodes.- Specified by:
getEqualIdGraphNodein interfaceNESTGraphObject- Returns:
- graph node with equal id, if exists
nullotherwise
-
updateGraphNodeId
public void updateGraphNodeId(String oldId, String newId)
Description copied from interface:NESTGraphObjectUpdates the internal list of registered graphnodes, when an id of a graph node changed.- Specified by:
updateGraphNodeIdin interfaceNESTGraphObject
-
getGraphNode
public NESTNodeObject getGraphNode(String id)
Description copied from interface:NESTGraphObjectReturns the graphnode with the given id from the internal list of graphnodes.- Specified by:
getGraphNodein interfaceNESTGraphObject- Parameters:
id- The id of the graphnode, which should be retrieved.- Returns:
-
getGraphEdge
public NESTEdgeObject getGraphEdge(String id)
Description copied from interface:NESTGraphObjectReturns the graph edge with the specified id.- Specified by:
getGraphEdgein interfaceNESTGraphObject- Parameters:
id- the id of the graph edge- Returns:
- the edge
-
getGraphNodes
public Set<NESTNodeObject> getGraphNodes()
Description copied from interface:NESTGraphObjectReturns the complete list of graph nodes registered in the graph.- Specified by:
getGraphNodesin interfaceNESTGraphObject- Returns:
- list of graph nodes in the graph.
-
getGraphNodes
public Set<NESTNodeObject> getGraphNodes(Predicate<? super NESTNodeObject> filter)
Description copied from interface:NESTGraphObjectReturns a list of graph nodes registered in the graph.- Specified by:
getGraphNodesin interfaceNESTGraphObject- Parameters:
filter- filter to apply- Returns:
- list of graph nodes in the graph
-
getGraphEdges
public Set<NESTEdgeObject> getGraphEdges()
Description copied from interface:NESTGraphObjectReturns the complete list of graphedges contained in the graph- Specified by:
getGraphEdgesin interfaceNESTGraphObject- Returns:
- List of graphedges in the graph.
-
containsValueFrom
public boolean containsValueFrom(NESTGraphObject graph)
Description copied from interface:NESTGraphObjectChecks, whether the given graph is entirely contained in this graph.- Specified by:
containsValueFromin interfaceNESTGraphObject- Parameters:
graph- given graph- Returns:
- true, if the given graph is entirely contained in this graph
-
containsValueFromWithExceptions
public boolean containsValueFromWithExceptions(NESTGraphObject graph) throws AssertSameValueAsInException
Description copied from interface:NESTGraphObjectChecks, whether the given graph is entirely contained in this graph.- Specified by:
containsValueFromWithExceptionsin interfaceNESTGraphObject- Parameters:
graph- given graph- Returns:
- true, if the given graph is entirely contained in this graph
- Throws:
AssertSameValueAsInException- exception with explanations
-
getIDManager
public NESTGraphIDManager getIDManager()
Description copied from interface:NESTGraphObjectReturns the ID-manager for this graph.- Specified by:
getIDManagerin interfaceNESTGraphObject- Returns:
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodesin interfaceNESTGraphObject- Returns:
-
getNumberOfEdges
public int getNumberOfEdges()
- Specified by:
getNumberOfEdgesin interfaceNESTGraphObject- Returns:
-
getModifier
public NESTGraphModifier getModifier()
Description copied from interface:NESTGraphObjectReturns the modifier.- Specified by:
getModifierin interfaceNESTGraphObject- Returns:
-
copy
public DataObject copy()
Description copied from interface:DataObjectMakes a deep copy of the data object- Specified by:
copyin interfaceDataObject- Overrides:
copyin classDataObjectImpl- Returns:
- deep copy of the data object
-
toString
public String toString()
- Overrides:
toStringin classDataObjectImpl
-
hasSameValueAsIn
public boolean hasSameValueAsIn(DataObject object)
Description copied from interface:DataObjectThis method makes a deep compare. For atomic objects this is equal to theequalmethod. For sets, lists, aggregates, and others a deeper comparision is performed.- Specified by:
hasSameValueAsInin interfaceDataObject- Overrides:
hasSameValueAsInin classDataObjectImpl- Parameters:
object- The object to compare.- Returns:
trueif the givenobjecthas the same value(s) as this one.
-
assertSameValueAsIn
public void assertSameValueAsIn(DataObject object) throws AssertSameValueAsInException
- Specified by:
assertSameValueAsInin interfaceDataObject- Overrides:
assertSameValueAsInin classDataObjectImpl- Throws:
AssertSameValueAsInException
-
updateDependencies
protected void updateDependencies(NESTNodeObject newItem)
Assures that the newly added item knows about this graphobject.
-
publishAddNode
protected void publishAddNode(NESTNodeObject newNode)
Distributes adding a node to the listeners- Parameters:
newNode- the node, which was added
-
publishRemoveNode
protected void publishRemoveNode(NESTNodeObject oldNode)
Distributes removing a node to the listeners- Parameters:
oldNode- the node, which was removed
-
checkAllowedGraphClasses
protected void checkAllowedGraphClasses(NESTGraphItemObject nestGraphItem)
-
getVisualizer
public NESTGraphVisualizer getVisualizer()
Description copied from interface:NESTGraphObjectReturns the default visualizer for this graph.- Specified by:
getVisualizerin interfaceNESTGraphObject- Returns:
-
getVisualizer
public NESTGraphVisualizer getVisualizer(Class clazz)
- Specified by:
getVisualizerin interfaceNESTGraphObject
-
-