Package net.automatalib.graph.concept
Interface NodeIDs<N>
-
- Type Parameters:
N
- node type of the graph
- All Known Implementing Classes:
AbstractCompactBidiGraph
,AbstractCompactGraph
,CompactBidiGraph
,CompactGraph
,CompactPMPG
,CompactSimpleBidiGraph
,CompactSimpleGraph
,SimpleNodeIDs
,StateAsNodeIDs
,WitnessTree
public interface NodeIDs<N>
An interface for translating between graph nodes and their primitive representations as integers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description N
getNode(int id)
Return for a given id the node of the graph identified by it.int
getNodeId(N node)
Returns for a given node of the graph an integer uniquely identifying the node.
-
-
-
Method Detail
-
getNodeId
int getNodeId(N node)
Returns for a given node of the graph an integer uniquely identifying the node. The returned ids should be within the range of the number of states of the graph so that they can be used for array-based indexing.- Parameters:
node
- the node whose id should be retrieved- Returns:
- the (positive) id of the given graph node.
- Throws:
IllegalArgumentException
- ifnode
does not belong to the graph.
-
getNode
N getNode(int id)
Return for a given id the node of the graph identified by it.- Parameters:
id
- the id of the node to be returned- Returns:
- the graph node identified by the given
id
. - Throws:
IllegalArgumentException
- if the givenid
does not identify a node of the graph.
-
-