Interface IGraph

All Superinterfaces:
Cloneable
All Known Implementing Classes:
Graph

public interface IGraph extends Cloneable
Abstraction of a TimeML Graph data structure
  • Method Details

    • addLink

      boolean addLink(ILink link)
      Adds a link to the graph.
      Parameters:
      link - The ILink to be added.
      Returns:
      True if the link was added, or false if the link already exist.
      Since:
      Revision 750
    • addNode

      boolean addNode(INode node)
      Adds a node to the graph.
      Parameters:
      node - The node to add
      Returns:
      True if the node was added, or False if the node already exists.
      Since:
      Revision 750
    • containsLink

      boolean containsLink(ILink link)
      Checks if the graph contains a link.
      Parameters:
      link - The ILink to check.
      Returns:
      True if the link is in the graph, else false
      Since:
      Revision 750
    • getNodeById

      INode getNodeById(int nodeId)
      Gets a node by id.
      Parameters:
      nodeId - The id of the node to retrieve.
      Returns:
      The node with the given id, or null if no such node exist.
      Since:
      Revision 750
    • getLinkById

      ILink getLinkById(int linkId)
      Gets a link by id.
      Parameters:
      linkId - The id of the link to retrieve.
      Returns:
      The link with the given id, or null if no such link exist.
      Since:
      Revision 750
    • removeLink

      ILink removeLink(ILink link)
      Removes a link from the graph.
      Parameters:
      link - The ILink to remove.
      Returns:
      The removed link, or null if the link is not in the graph.
      Since:
      Revision 750
    • removeNode

      INode removeNode(INode node)
      Removes a node from the graph.
      Parameters:
      node - The node to remove.
      Returns:
      The removed node, or null if the node is not in the graph.
      Since:
      Revision 750
    • removeNodeById

      INode removeNodeById(int nodeId)
      Removes a node by id.
      Parameters:
      nodeId - The id of the node to remove.
      Returns:
      The removed node, or null, if the node is not in the graph.
      Since:
      Revision 750
    • getNodes

      Set<INode> getNodes()
      Returns all the nodes in the graph.
      Returns:
      A set of the nodes in the graph.
      Since:
      Revision 750
    • getLinks

      Set<ILink> getLinks()
      Returns all the links in the graph.
      Returns:
      A set of the links in the graph.
      Since:
      Revision 750
    • getLinksCount

      int getLinksCount()
      Returns the number of links in the graph.
      Returns:
      The number of links in the graph.
      Since:
      Revision 750
    • getNodesCount

      int getNodesCount()
      Gets the number of nodes in a graph.
      Returns:
      The number of nodes in the graph.
      Since:
      Revision 750
    • getLinkTypesCount

      Map<String,Integer> getLinkTypesCount()
      Gets the link count per link type.
      Returns:
      A map containing the number of A-Link, S-Link, and T-Link.
      Since:
      Revision 750
    • getGraphType

      edu.fiu.jtlex.data.GraphType getGraphType()
      Gets the Graph's type.
      Returns:
      A GraphType representing the graph type.
      Since:
      Revision 750
    • setGraphType

      void setGraphType(edu.fiu.jtlex.data.GraphType graphType)
      Changes the graph type.
      Parameters:
      graphType - The GraphType enum.
      Since:
      Revision 750
    • clone

      IGraph clone()
      Creates a clone of the graph.
      Returns:
      A deep copy of the graph.
      Since:
      Revision 750
    • toJson

      String toJson()
      Returns the JSON (RFC 8259) representation of the graph.
      Returns:
      A flattened JSON string of the graph.
      Since:
      Revision 750