Package org.neo4j.gds.api
Interface IdMap
-
- All Superinterfaces:
BatchNodeIterable
,NodeIterator
- All Known Implementing Classes:
CSRGraphAdapter
,GraphAdapter
,HugeGraph
,HugeIdMap
,NodeFilteredGraph
,UnionGraph
public interface IdMap extends NodeIterator, BatchNodeIterable
Bi-directional mapping between two id spaces.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
IdMap.NodeLabelConsumer
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.BatchNodeIterable
BatchNodeIterable.IdIterable, BatchNodeIterable.IdIterator
-
-
Field Summary
Fields Modifier and Type Field Description static long
NOT_FOUND
Defines the value for unmapped idsstatic long
START_NODE_ID
Defines the lower bound of mapped ids TODO: function?
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Set<org.neo4j.gds.NodeLabel>
availableNodeLabels()
default IdMap
cloneIdMap()
boolean
contains(long nodeId)
Returns true iff the nodeId is mapped, otherwise false.void
forEachNodeLabel(long nodeId, IdMap.NodeLabelConsumer consumer)
boolean
hasLabel(long nodeId, org.neo4j.gds.NodeLabel label)
long
highestNeoId()
long
nodeCount()
Number of mapped nodeIds.java.util.Set<org.neo4j.gds.NodeLabel>
nodeLabels(long nodeId)
IdMap
rootIdMap()
Returns the original node mapping if the current node mapping is filtered, otherwise it returns itself.long
rootNodeCount()
Number of mapped node ids in the root mapping.default long
safeToMappedNodeId(long nodeId)
Map original nodeId to inner nodeId Returns org.neo4j.gds.api.IdMap#NOT_FOUND if the nodeId is not mapped.long
toMappedNodeId(long nodeId)
Map original nodeId to inner nodeIdlong
toOriginalNodeId(long nodeId)
Map inner nodeId back to original nodeIdlong
toRootNodeId(long nodeId)
Maps an internal id to its root internal node id.default IdMap
withFilteredLabels(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels, int concurrency)
-
Methods inherited from interface org.neo4j.gds.api.BatchNodeIterable
batchIterables
-
Methods inherited from interface org.neo4j.gds.api.NodeIterator
forEachNode, nodeIterator
-
-
-
-
Field Detail
-
START_NODE_ID
static final long START_NODE_ID
Defines the lower bound of mapped ids TODO: function?- See Also:
- Constant Field Values
-
NOT_FOUND
static final long NOT_FOUND
Defines the value for unmapped ids- See Also:
- Constant Field Values
-
-
Method Detail
-
toMappedNodeId
long toMappedNodeId(long nodeId)
Map original nodeId to inner nodeId- Parameters:
nodeId
- must be smaller or equal to the id returned byhighestNeoId()
-
safeToMappedNodeId
default long safeToMappedNodeId(long nodeId)
Map original nodeId to inner nodeId Returns org.neo4j.gds.api.IdMap#NOT_FOUND if the nodeId is not mapped.
-
toOriginalNodeId
long toOriginalNodeId(long nodeId)
Map inner nodeId back to original nodeId
-
toRootNodeId
long toRootNodeId(long nodeId)
Maps an internal id to its root internal node id. This is necessary for nested (filtered) id mappings. If this mapping is a nested mapping, this method returns the root node id of the parent mapping. For the root mapping this method returns the given node id.
-
contains
boolean contains(long nodeId)
Returns true iff the nodeId is mapped, otherwise false.
-
nodeCount
long nodeCount()
Number of mapped nodeIds.
-
rootNodeCount
long rootNodeCount()
Number of mapped node ids in the root mapping. This is necessary for nested (filtered) id mappings.
-
highestNeoId
long highestNeoId()
-
cloneIdMap
default IdMap cloneIdMap()
-
nodeLabels
java.util.Set<org.neo4j.gds.NodeLabel> nodeLabels(long nodeId)
-
forEachNodeLabel
void forEachNodeLabel(long nodeId, IdMap.NodeLabelConsumer consumer)
-
availableNodeLabels
java.util.Set<org.neo4j.gds.NodeLabel> availableNodeLabels()
-
hasLabel
boolean hasLabel(long nodeId, org.neo4j.gds.NodeLabel label)
-
rootIdMap
IdMap rootIdMap()
Returns the original node mapping if the current node mapping is filtered, otherwise it returns itself.
-
withFilteredLabels
default IdMap withFilteredLabels(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels, int concurrency)
-
-