

package com.touchgraph.graphlayout.graphelements;

import com.touchgraph.graphlayout.Edge;
import com.touchgraph.graphlayout.Node;


// import java.util.Collection;
// import java.util.Iterator;

/**
 * ImmutableGraphEltSet provides access to the elements of GraphElementSet that does not allow for addition or deletion
 * of nodes or edges.
 * @author Alexander Shapiro
 * @version 1.22-jre1.1 $Id: ImmutableGraphEltSet.java,v 1.1 2007/11/10 23:36:18 mindraider Exp $
 */
public interface ImmutableGraphEltSet
{

    /**
     * Return the number of Nodes in the cumulative Vector.
     * @return the number of nodes.
     */
    public int nodeCount();

    /**
     * Return the current Node count.
     * @return the number of current node count.
     * @deprecated this method has been replaced by the <tt>nodeCount()</tt> method.
     */
    public int nodeNum();

    /*
     * Return an iterator over the Nodes in the cumulative Vector, null if it is empty. public Iterator getNodes();
     */

    /**
     * Return the number of Edges in the cumulative Vector.
     * @return the edge count.
     */
    public int edgeCount();

    /**
     * Return the current Edge count.
     * @return the count of current edge.
     * @deprecated this method has been replaced by the <tt>edgeCount()</tt> method.
     */
    public int edgeNum();

    /*
     * Return an iterator over the Edges in the cumulative Vector, null if it is empty. public Iterator getEdges();
     */

    /**
     * Return the Node whose ID matches the String <tt>id</tt>, null if no match is found.
     * @param id the string to find.
     */
    public Node findNode(String id);

    /*
     * Return a Collection of all Nodes whose label matches the String <tt>label</tt>, null if no match is found.
     * public Collection findNodesByLabel( String label );
     */

    /**
     * Return the first Nodes whose label contains the String <tt>substring</tt>, null if no match is found.
     * @param the substring to check.
     * @return the first node if found, otherwise <code>null</code>.
     */
    public Node findNodeLabelContaining(String substring);

    /**
     * Return an Edge spanning Node <tt>from</tt> to Node <tt>to</tt>.
     * @param from the start node.
     * @param to the end node.
     * @return the edge between nodes.
     */
    public Edge findEdge(Node from, Node to);

    /**
     * Returns a random node, or null if none exist (for making random graphs).
     * @return a random node
     */
    public Node getRandomNode();

    /**
     * Return the first Node
     * @return Returns the first <code>node</code>, otherwise <code>null</code>.
     */
    public Node getFirstNode();

    /**
     * Iterates through all the nodes.
     * @param fen the TGForEachNode.
     */
    public void forAllNodes(TGForEachNode fen);

    /**
     * Iterates through pairs of Nodes.
     * @param fenp TGForEachNodePair.
     */
    public void forAllNodePairs(TGForEachNodePair fenp);

    /**
     * Iterates through Edges.
     * @param fee the TGForEachEdge.
     */
    public void forAllEdges(TGForEachEdge fee);
}