Package org.neo4j.gds.api
Class IdMapAdapter
- java.lang.Object
-
- org.neo4j.gds.api.IdMapAdapter
-
- All Implemented Interfaces:
BatchNodeIterable
,IdMap
,NodeIterator
,PartialIdMap
public abstract class IdMapAdapter extends java.lang.Object implements IdMap
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.BatchNodeIterable
BatchNodeIterable.BitSetIdIterator, BatchNodeIterable.IdIterable, BatchNodeIterable.IdIterator
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.IdMap
IdMap.NodeLabelConsumer
-
-
Field Summary
-
Fields inherited from interface org.neo4j.gds.api.IdMap
NOT_FOUND, START_NODE_ID
-
-
Constructor Summary
Constructors Constructor Description IdMapAdapter(IdMap idMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<org.neo4j.gds.NodeLabel>
availableNodeLabels()
java.util.Collection<PrimitiveLongIterable>
batchIterables(long batchSize)
boolean
contains(long nodeId)
Returns true iff the nodeId is mapped, otherwise false.void
forEachNode(java.util.function.LongPredicate consumer)
Iterate over each nodeIdvoid
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.PrimitiveIterator.OfLong
nodeIterator()
java.util.PrimitiveIterator.OfLong
nodeIterator(java.util.Set<org.neo4j.gds.NodeLabel> labels)
java.util.List<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.java.util.OptionalLong
rootNodeCount()
Number of mapped node ids in the root mapping.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.IdMap
withFilteredLabels(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels, int concurrency)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.neo4j.gds.api.IdMap
safeToMappedNodeId
-
-
-
-
Constructor Detail
-
IdMapAdapter
public IdMapAdapter(IdMap idMap)
-
-
Method Detail
-
batchIterables
public java.util.Collection<PrimitiveLongIterable> batchIterables(long batchSize)
- Specified by:
batchIterables
in interfaceBatchNodeIterable
- Returns:
- a collection of iterables over every node, partitioned by the given batch size.
-
toMappedNodeId
public long toMappedNodeId(long nodeId)
Description copied from interface:PartialIdMap
Map original nodeId to inner nodeId- Specified by:
toMappedNodeId
in interfacePartialIdMap
- Parameters:
nodeId
- must be smaller or equal to the id returned byIdMap.highestNeoId()
-
toOriginalNodeId
public long toOriginalNodeId(long nodeId)
Description copied from interface:IdMap
Map inner nodeId back to original nodeId- Specified by:
toOriginalNodeId
in interfaceIdMap
-
toRootNodeId
public long toRootNodeId(long nodeId)
Description copied from interface:IdMap
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.- Specified by:
toRootNodeId
in interfaceIdMap
-
rootIdMap
public IdMap rootIdMap()
Description copied from interface:IdMap
Returns the original node mapping if the current node mapping is filtered, otherwise it returns itself.
-
contains
public boolean contains(long nodeId)
Description copied from interface:IdMap
Returns true iff the nodeId is mapped, otherwise false.
-
nodeCount
public long nodeCount()
Description copied from interface:IdMap
Number of mapped nodeIds.
-
rootNodeCount
public java.util.OptionalLong rootNodeCount()
Description copied from interface:PartialIdMap
Number of mapped node ids in the root mapping. This is necessary for nested (filtered) id mappings.- Specified by:
rootNodeCount
in interfacePartialIdMap
-
highestNeoId
public long highestNeoId()
- Specified by:
highestNeoId
in interfaceIdMap
-
forEachNode
public void forEachNode(java.util.function.LongPredicate consumer)
Description copied from interface:NodeIterator
Iterate over each nodeId- Specified by:
forEachNode
in interfaceNodeIterator
-
nodeIterator
public java.util.PrimitiveIterator.OfLong nodeIterator()
- Specified by:
nodeIterator
in interfaceNodeIterator
-
nodeIterator
public java.util.PrimitiveIterator.OfLong nodeIterator(java.util.Set<org.neo4j.gds.NodeLabel> labels)
- Specified by:
nodeIterator
in interfaceNodeIterator
-
nodeLabels
public java.util.List<org.neo4j.gds.NodeLabel> nodeLabels(long nodeId)
- Specified by:
nodeLabels
in interfaceIdMap
-
forEachNodeLabel
public void forEachNodeLabel(long nodeId, IdMap.NodeLabelConsumer consumer)
- Specified by:
forEachNodeLabel
in interfaceIdMap
-
availableNodeLabels
public java.util.Set<org.neo4j.gds.NodeLabel> availableNodeLabels()
- Specified by:
availableNodeLabels
in interfaceIdMap
-
hasLabel
public boolean hasLabel(long nodeId, org.neo4j.gds.NodeLabel label)
-
withFilteredLabels
public IdMap withFilteredLabels(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels, int concurrency)
- Specified by:
withFilteredLabels
in interfaceIdMap
-
-