- All Superinterfaces:
IndexedDirectedGraph
- All Known Subinterfaces:
AttributedIndexedBidiGraph<V,,A> IntAttributedIndexedBidiGraph,MutableIndexedBidiGraph
- All Known Implementing Classes:
AbstractMutableIndexedBidiGraph,ChunkedMutableIndexedBidiGraph,ImmutableAttributed32BitIndexedBidiGraph,MutableIntAttributed16BitIndexedBidiGraph
This interface provides read access to a directed graph
G = (int, A) .
This interface provides access to the following data in addition to the data
that interface DirectedGraph provides:
- The previous count
prevCount_iof the vertexv_i. - The
k-th previous vertex of the vertexv_i, withk ∈ {0, ..., getPrevCount(i) - 1}.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptiondefault intfindIndexOfPrevAsInt(int v, int u) Returns the index of the arrow fromvtouin the list of next-vertices fromv.intgetPrevArrowAsInt(int v, int i) Returns the arrow data of thei-th ingoing arrow tov.intgetPrevAsInt(int v, int i) Returns thei-th previous vertex ofv.intgetPrevCount(int v) Returns the number of direct predecessor vertices of v.default booleanisPrevAsInt(int v, int u) Returns whether there is an arrow from vertexuto vertexv.default @NonNull Enumerator.OfIntprevVerticesEnumerator(int v) Returns the direct successor vertices of the specified vertex.Methods inherited from interface org.jhotdraw8.graph.IndexedDirectedGraph
findIndexOfNextAsInt, getArrowCount, getNextArrowAsInt, getNextAsInt, getNextCount, getVertexCount, isNextAsInt, nextVerticesEnumerator
-
Method Details
-
getPrevAsInt
int getPrevAsInt(int v, int i) Returns thei-th previous vertex ofv.- Parameters:
v- index of vertex vi- index of ingoing arrow- Returns:
- the vertex index of the ingoing arrow
-
getPrevArrowAsInt
int getPrevArrowAsInt(int v, int i) Returns the arrow data of thei-th ingoing arrow tov.- Parameters:
v- index of vertex vi- index of ingoing arrow- Returns:
- the arrow data of the ingoing arrow
-
getPrevCount
int getPrevCount(int v) Returns the number of direct predecessor vertices of v.- Parameters:
v- index of vertex v- Returns:
- the number of next vertices of v.
-
prevVerticesEnumerator
Returns the direct successor vertices of the specified vertex.- Parameters:
v- index of vertex v- Returns:
- a collection view on the direct successor vertices of vertex
-
findIndexOfPrevAsInt
default int findIndexOfPrevAsInt(int v, int u) Returns the index of the arrow fromvtouin the list of next-vertices fromv.- Parameters:
v- vertexvu- vertexu- Returns:
- index of vertex
uin the list of next-vertices fromv. Returns a value < 0 ifuis not in the list.
-
isPrevAsInt
default boolean isPrevAsInt(int v, int u) Returns whether there is an arrow from vertexuto vertexv.- Parameters:
v- a vertexu- a vertex- Returns:
- true if there is an arrow from
utov
-