-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e45e526
commit 02bc66b
Showing
9 changed files
with
149 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ph/src/main/java/org.jhotdraw8.graph/org/jhotdraw8/graph/MutableIndexedDirectedGraph.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.jhotdraw8.graph; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
/** | ||
* FIXME ensure that the methods do not clash with {@link MutableIndexedBidiGraph} | ||
*/ | ||
public interface MutableIndexedDirectedGraph extends IndexedDirectedGraph { | ||
/** | ||
* Adds an arrow from vertex 'v' to vertex 'u'. | ||
* | ||
* @param v index of vertex 'v' | ||
* @param u index of vertex 'u' | ||
*/ | ||
int addArrowAsInt(int v, int u); | ||
|
||
|
||
/** | ||
* Adds a vertex to the graph. | ||
*/ | ||
void addVertexAsInt(); | ||
|
||
|
||
/** | ||
* Removes an arrow from vertex 'v' to vertex 'u' | ||
* | ||
* @param v index of vertex 'v' | ||
* @param u index of vertex 'u' | ||
* @throws NoSuchElementException if there is no such arrow | ||
*/ | ||
default void removeArrowAsInt(int v, int u) { | ||
removeNextAsInt(v, findIndexOfNextAsInt(v, u)); | ||
} | ||
|
||
/** | ||
* Removes the i-th arrow starting at vertex 'v' | ||
* | ||
* @param v index of vertex 'v' | ||
* @param index the index of the arrow starting at 'v' | ||
* @throws NoSuchElementException if there is no such arrow | ||
*/ | ||
int removeNextAsInt(int v, int index); | ||
|
||
|
||
/** | ||
* Removes vertex 'v' | ||
* | ||
* @param v index of vertex 'v' | ||
*/ | ||
void removeVertexAsInt(int v); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.