Class Model.RuntimeModel

java.lang.Object
org.graphwalker.core.model.RuntimeBase
org.graphwalker.core.model.Model.RuntimeModel
All Implemented Interfaces:
Element
Enclosing class:
Model

public static class Model.RuntimeModel extends RuntimeBase

RuntimeModel

Immutable class for Model

An immutable model guarantees that that the internal states of the instance will not change after it's construction.
  • Method Details

    • getVertices

      public List<Vertex.RuntimeVertex> getVertices()
      Gets the list of vertices of the model.
      Returns:
      The list of vertices
      See Also:
    • getSharedStates

      public Set<String> getSharedStates()
      Gets the unique list of shared state names.
      Returns:
      The list of shared states.
      See Also:
    • getSharedStates

      public List<Vertex.RuntimeVertex> getSharedStates(String sharedState)
      Gets the list of vertices that matches a shared state name.
      Parameters:
      sharedState - The shared state name too be matched.
      Returns:
      The list of matching shared states.
      See Also:
    • hasSharedState

      public boolean hasSharedState(String sharedState)
      Will search in the model if there is a vertex that has a shared state name that matches the given name.
      Parameters:
      sharedState - The shared state name too be matched.
      Returns:
      True if the model has a matching shared state.
      See Also:
    • hasSharedStates

      public boolean hasSharedStates()
      Will search the model for vertices that has shared states. If any is found, then true will be returned.
      Returns:
      True if the models has any vertex with a shared state.
      See Also:
    • findVertices

      public List<Vertex.RuntimeVertex> findVertices(String name)
      Searches the model vertices that matches search string.
      Parameters:
      name - The name of the vertex as a string.
      Returns:
      The list of matching vertices.
      See Also:
    • getInEdges

      public List<Edge.RuntimeEdge> getInEdges(Vertex.RuntimeVertex vertex)
      For the given vertex, all in-edges will be returned.

      Any edge that has a target vertex that is identical to vertex, will be returned.
      Parameters:
      vertex - The vertex to match
      Returns:
      List of matching in-edges.
    • getEdges

      public List<Edge.RuntimeEdge> getEdges()
      Gets the all edges in the model.
      Returns:
      A list of edges.
    • getOutEdges

      public List<Edge.RuntimeEdge> getOutEdges(Vertex.RuntimeVertex vertex)
      For the given vertex, all out-edges will be returned.

      Any edge that has a source vertex that is identical to vertex, will be returned.
      Parameters:
      vertex - The vertex to match
      Returns:
      List of matching out-edges.
    • findEdges

      public List<Edge.RuntimeEdge> findEdges(String name)
      Searches the model for edges matching the search string.

      Any edge that has a matching name, will be returned.
      Parameters:
      name - The name of edges to be matched.
      Returns:
      The list of matching edges.
      See Also:
    • getPredefinedPath

      public List<Edge.RuntimeEdge> getPredefinedPath()
    • hasPredefinedPath

      public boolean hasPredefinedPath()
    • findElements

      public List<Element> findElements(String name)
      Searches the model for any element matching the search string.

      Any element that has a matching name, will be returned. An element can be either an edge or a vertex.
      Parameters:
      name - The name of elements to be matched.
      Returns:
      The list of matching elements.
      See Also:
    • getElements

      public List<Element> getElements()
      Will return a list of all elements in a model.

      The list will contain all edges and vertices in the model.
      Returns:
      The list of all elements in the model.
    • getElementById

      public Element getElementById(String id)
      Will return the element with the given id.

      Parameters:
      id - The id of the element.
      Returns:
      The element with the given id
    • getElements

      public List<Element> getElements(Element element)
      TODO: Add doc
    • accept

      public void accept(ElementVisitor visitor)
      TODO: Doc...
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class RuntimeBase
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class RuntimeBase