package graph;

import java.util.NoSuchElementException;

/**
 * Created by Paweł Kopeć on 23.12.16.
 *
 * SubgraphFind interface enables operating
 * on graph's subgraphs without changing
 * the topology of initial graph.
 */
public interface SubgraphFind {

    /**
     * From now Graph acts as if there was no vertex of given index
     * and no edges between it and its neighbours.
     *
     * @param index of vertex to be disabled
     * @return true if this vertex was not already disabled
     * @throws NoSuchElementException if there is no vertex of such index
     */
    boolean disable(int index) throws NoSuchElementException;

    /**
     * Undos action performed by the above.
     * @see #disable(int)
     *
     * @param index of vertex to be enabled
     * @return true if this vertex was not already enabled
     * @throws NoSuchElementException if there is no vertex of such index
     */
    boolean enable(int index) throws NoSuchElementException;

    /**
     * Disables all vertices in a graph.
     *
     * @see #disable(int)
     */
    void disableAll();

    /**
     * Enables all vertices in a graph.
     *
     * @see #enable(int)
     */
    void enableAll();
}

@@ -9,16 +9,45 @@
 graph;%0A%0A
+import java.util.LinkedList;%0A
 import j
@@ -79,16 +79,16 @@
 eption;%0A
-
 %0A/**%0A * 
@@ -685,16 +685,17 @@
   * Undo
+e
 s action
@@ -1193,32 +1193,32 @@
 le(int)%0A     */%0A
-
     void enableA
@@ -1222,11 +1222,342 @@
 leAll();
+%0A%0A    /**%0A     * Returns a list of enabled vertices indexes.%0A     *%0A     * @return list of enabled vertices indexes%0A     */%0A    LinkedList%3CInteger%3E getAllEnabled();%0A%0A    /**%0A     * Returns a list of disabled vertices indexes.%0A     *%0A     * @return list of disabled vertices indexes%0A     */%0A    LinkedList%3CInteger%3E getAllDisabled();
 %0A%7D%0A

Add methods toSubgraphFind.