package edu.fiu.jtlex.data;


import edu.fiu.jtlex.data.ILink.LinkTag;
import edu.fiu.jtlex.data.ILink.Origintype;
import java.util.HashMap;
import java.util.Set;

/**
 * Represents a TimeML Graph: A TimeML temporal graph is a graph T = (V,E)
 * where: V is a set of temporal events and time expressions. E is a set of
 * TimeML links: a tuple (u,v,w) where u, v belong to V and w is a link type.
 * There are 25 link types, refer to @see ILink.java
 * 
 * @author Luis Robaina
 */
public interface IGraph {

	/**
	 * 
	 * @param one      First Node in the Link
	 * @param two      Second Node in the Link
	 * @param linkType The type of Link (There are 25 link types).
	 * @return True if the Link was added to the TimeML graph. False if the Link was
	 *         not added.
	 */
	public boolean addLink(INode one, INode two, LinkTag linktag, ILinkType linkType, String syntax, ISignal signal,
			Origintype orig);

	/**
	 * 
	 * @param one      The ID of the first Node in the Link
	 * @param two      The ID of the second Node in the Link
	 * @param linkType The type of Link (There are 25 link types).
	 * @return True if the Link was added to the TimeML graph. False if the Link was
	 *         not added.
	 */
	public boolean addLink(int NodeOneID, int NodeTwoID, LinkTag linktag, ILinkType linkType, String syntax,
			ISignal signal, Origintype orig);

	/**
	 * 
	 * @param link A Link of interest to be checked for in the TimeML graph.
	 * @return True if link exists in the TimeML graph
	 */
	public boolean containsLink(ILink link);

	/**
	 * 
	 * @param link: An ILink to be removed from the TimeML graph.
	 * @return The ILink removed from the TimeML graph
	 */
	public ILink removeLink(ILink link);

	/**
	 * 
	 * @param node: The INode to be added to the TimeML graph.
	 * @return True if the node was added. False if node was not added.
	 */
	public boolean addNode(INode node);

	/**
	 * 
	 * @param link: The ILink to be added to the TimeML graph.
	 * @return True if the node was added. False if node was not added.
	 */
	public boolean addLink(ILink link);

	
	/**
	 * 
	 * @param ID: Each node in the TimeML graph has to be identified by a unique ID
	 *            number.
	 * @return The INode removed from the TimeML graph, (null) if the INode with ID
	 *         is not in TimeML graph.
	 */
	public INode removeNodeByID(int ID);

	/**
	 * 
	 * @return A set with all the Links in the TimeML graph, (null) if the TimeML
	 *         graph is empty.
	 */
	public Set<ILink> getLinks();

	/**
	 * Returns a INode reference if a node with ID NodeID exists in the graph
	 * returns null otherwise.
	 * 
	 * @param NodeID: An Integer ID for a given node.
	 * @return A INode reference if a node with ID NodeID exists in the graph
	 *         returns null otherwise.
	 */
	public INode getNodeByID(int NodeID);

	/**
	 * 
	 * @return A set with all the Nodes in the TimeML graph, (null) if the TimeML
	 *         graph is empty.
	 */
	public Set<INode> getNodes();
	
	//  Getters for counts of links and nodes.
	public int getLinksCount();
	public int getNodesCount();
	
	
	public HashMap<String, Integer> getLinkTypesCount();

	public GraphType getGraphType();

	public void setGraphType(GraphType subbordinationgraph);

}