Package net.automatalib.graph.concept
Interface NodeIDs<N>
-
- Type Parameters:
N- node type of the graph
- All Known Implementing Classes:
SimpleNodeIDs,StateAsNodeIDs
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 NgetNode(int id)Return for a given id the node of the graph identified by it.intgetNodeId(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- ifnodedoes 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 giveniddoes not identify a node of the graph.
-
-