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 Details

    • 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 Details

    • NESTGraphObjectImpl

      public NESTGraphObjectImpl(NESTGraphClass cakeclazz)
      Standard constructor of CAKE
      Parameters:
      cakeclazz -
  • Method Details

    • addGraphNode

      public void addGraphNode(NESTNodeObject newGraphNode)
      Description copied from interface: NESTGraphObject
      Adds 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:
      addGraphNode in interface NESTGraphObject
      Parameters:
      newGraphNode - The graphnode, which should be registered.
    • removeGraphNode

      public boolean removeGraphNode(String id)
      Description copied from interface: NESTGraphObject
      Removes 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:
      removeGraphNode in interface NESTGraphObject
      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: NESTGraphObject
      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.
      Specified by:
      getSemanticallyEqualNode in interface NESTGraphObject
      Parameters:
      node - the node that is compared to the other nodes of the graph
      simVal - The similarity valuator to use
      simMeasure - The name of the similarity measure to use
      Returns:
      semantic equal graph node, if exists null otherwise
    • getSemanticallyEqualNode

      public <T extends NESTNodeObject> T getSemanticallyEqualNode(T node)
      Description copied from interface: NESTGraphObject
      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. The default similarity valuator and measure are used.
      Specified by:
      getSemanticallyEqualNode in interface NESTGraphObject
      Parameters:
      node - the node that is compared to the other nodes of the graph
      Returns:
      semantic equal graph node, if exists null otherwise
    • getEqualIdGraphNode

      public NESTNodeObject getEqualIdGraphNode(NESTNodeObject node)
      Description copied from interface: NESTGraphObject
      Returns the graph node whose id is equal to the given node from the internal list of graphnodes.
      Specified by:
      getEqualIdGraphNode in interface NESTGraphObject
      Returns:
      graph node with equal id, if exists null otherwise
    • updateGraphNodeId

      public void updateGraphNodeId(String oldId, String newId)
      Description copied from interface: NESTGraphObject
      Updates the internal list of registered graphnodes, when an id of a graph node changed.
      Specified by:
      updateGraphNodeId in interface NESTGraphObject
    • getGraphNode

      public NESTNodeObject getGraphNode(String id)
      Description copied from interface: NESTGraphObject
      Returns the graphnode with the given id from the internal list of graphnodes.
      Specified by:
      getGraphNode in interface NESTGraphObject
      Parameters:
      id - The id of the graphnode, which should be retrieved.
      Returns:
    • getGraphEdge

      public NESTEdgeObject getGraphEdge(String id)
      Description copied from interface: NESTGraphObject
      Returns the graph edge with the specified id.
      Specified by:
      getGraphEdge in interface NESTGraphObject
      Parameters:
      id - the id of the graph edge
      Returns:
      the edge
    • getGraphNodes

      public Set<NESTNodeObject> getGraphNodes()
      Description copied from interface: NESTGraphObject
      Returns the complete list of graph nodes registered in the graph.
      Specified by:
      getGraphNodes in interface NESTGraphObject
      Returns:
      list of graph nodes in the graph.
    • getGraphNodes

      public Set<NESTNodeObject> getGraphNodes(Predicate<? super NESTNodeObject> filter)
      Description copied from interface: NESTGraphObject
      Returns a list of graph nodes registered in the graph.
      Specified by:
      getGraphNodes in interface NESTGraphObject
      Parameters:
      filter - filter to apply
      Returns:
      list of graph nodes in the graph
    • getGraphEdges

      public Set<NESTEdgeObject> getGraphEdges()
      Description copied from interface: NESTGraphObject
      Returns the complete list of graphedges contained in the graph
      Specified by:
      getGraphEdges in interface NESTGraphObject
      Returns:
      List of graphedges in the graph.
    • containsValueFrom

      public boolean containsValueFrom(NESTGraphObject graph)
      Description copied from interface: NESTGraphObject
      Checks, whether the given graph is entirely contained in this graph.
      Specified by:
      containsValueFrom in interface NESTGraphObject
      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: NESTGraphObject
      Checks, whether the given graph is entirely contained in this graph.
      Specified by:
      containsValueFromWithExceptions in interface NESTGraphObject
      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: NESTGraphObject
      Returns the ID-manager for this graph.
      Specified by:
      getIDManager in interface NESTGraphObject
      Returns:
    • getNumberOfNodes

      public int getNumberOfNodes()
      Specified by:
      getNumberOfNodes in interface NESTGraphObject
      Returns:
    • getNumberOfEdges

      public int getNumberOfEdges()
      Specified by:
      getNumberOfEdges in interface NESTGraphObject
      Returns:
    • getModifier

      public NESTGraphModifier getModifier()
      Description copied from interface: NESTGraphObject
      Returns the modifier.
      Specified by:
      getModifier in interface NESTGraphObject
      Returns:
    • copy

      public DataObject copy()
      Description copied from interface: DataObject
      Makes a deep copy of the data object
      Specified by:
      copy in interface DataObject
      Overrides:
      copy in class DataObjectImpl
      Returns:
      deep copy of the data object
    • toString

      public String toString()
      Overrides:
      toString in class DataObjectImpl
    • hasSameValueAsIn

      public boolean hasSameValueAsIn(DataObject object)
      Description copied from interface: DataObject
      This method makes a deep compare. For atomic objects this is equal to the equal method. For sets, lists, aggregates, and others a deeper comparision is performed.
      Specified by:
      hasSameValueAsIn in interface DataObject
      Overrides:
      hasSameValueAsIn in class DataObjectImpl
      Parameters:
      object - The object to compare.
      Returns:
      true if the given object has the same value(s) as this one.
    • assertSameValueAsIn

      public void assertSameValueAsIn(DataObject object) throws AssertSameValueAsInException
      Specified by:
      assertSameValueAsIn in interface DataObject
      Overrides:
      assertSameValueAsIn in class DataObjectImpl
      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: NESTGraphObject
      Returns the default visualizer for this graph.
      Specified by:
      getVisualizer in interface NESTGraphObject
      Returns:
    • getVisualizer

      public NESTGraphVisualizer getVisualizer(Class clazz)
      Specified by:
      getVisualizer in interface NESTGraphObject