- All Known Subinterfaces:
AttributedIndexedBidiGraph<V,,A> AttributedIndexedDirectedGraph<V,,A> IndexedBidiGraph,IntAttributedIndexedBidiGraph,IntAttributedIndexedDirectedGraph,MutableIndexedBidiGraph
- All Known Implementing Classes:
AbstractDirectedGraphBuilder,AbstractMutableIndexedBidiGraph,ChunkedMutableIndexedBidiGraph,ImmutableAttributed16BitIndexedDirectedGraph,ImmutableAttributed32BitIndexedBidiGraph,ImmutableAttributed32BitIndexedDirectedGraph,MutableIntAttributed16BitIndexedBidiGraph,SimpleMutableDirectedGraph
public interface IndexedDirectedGraph
Provides indexed read access to a directed graph
G = (V, A) .
Gis a tuple(V, A).Vis the set of vertices with elementsv_i ∈ V. i ∈ {0, ..., vertexCount - 1}.Ais the set of ordered pairs with elements(v_i, v_j)_k ∈ A. i,j ∈ {0, ..., vertexCount - 1}. k ∈ {0, ..., arrowCount - 1}.
The API of this class provides access to the following data:
- The vertex count
vertexCount. - The arrow count
arrowCount. - The index
iof each vertexv_i ∈ V. - The index
kof each arrowa_k ∈ A. - The next count
nextCount_iof the vertex with indexi. - The index of the
k-th next vertex of the vertex with indexi, and withk ∈ {0, ..., nextCount_i - 1}.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptiondefault intfindIndexOfNextAsInt(int v, int u) Returns the index of vertex b.intReturns the number of arrows.intgetNextArrowAsInt(int v, int i) Returns thei-th next arrow ofv.intgetNextAsInt(int v, int i) Returns thei-th next vertex ofv.intgetNextCount(int v) Returns the number of next vertices of v.intReturns the number of verticesV.default booleanisNextAsInt(int v, int u) Returns whether there is an arrow from vertexvto vertexu.default @NonNull Enumerator.OfIntnextVerticesEnumerator(int v) Returns the direct successor vertices of the specified vertex.
-
Method Details
-
getArrowCount
int getArrowCount()Returns the number of arrows.- Returns:
- arrow count
-
getNextAsInt
int getNextAsInt(int v, int i) Returns thei-th next vertex ofv.- Parameters:
v- a vertex indexi- the index of the desired next vertex,i ∈ {0, ..., getNextCount(v) -1 }.- Returns:
- the vertex index of the i-th next vertex of v.
-
getNextArrowAsInt
int getNextArrowAsInt(int v, int i) Returns thei-th next arrow ofv.- Parameters:
v- a vertex indexi- the index of the desired arrow,i ∈ {0, ..., getNextCount(v) -1 }.- Returns:
- the arrow data of the i-th next vertex of v.
-
getNextCount
int getNextCount(int v) Returns the number of next vertices of v.- Parameters:
v- a vertex- Returns:
- the number of next vertices of v.
-
getVertexCount
int getVertexCount()Returns the number of verticesV.- Returns:
- vertex count
-
findIndexOfNextAsInt
default int findIndexOfNextAsInt(int v, int u) Returns the index of vertex b.- Parameters:
v- a vertexu- another vertex- Returns:
- index of vertex b. Returns a value < 0 if b is not a next vertex of a.
-
isNextAsInt
default boolean isNextAsInt(int v, int u) Returns whether there is an arrow from vertexvto vertexu.- Parameters:
v- a vertexu- another vertex- Returns:
- true if there is an arrow from
utov
-
nextVerticesEnumerator
Returns the direct successor vertices of the specified vertex.- Parameters:
v- a vertex index- Returns:
- a collection view on the direct successor vertices of vertex
-