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)booleancontains(long originalNodeId)Returns true iff the neo4jNodeId is mapped, otherwise false.voidforEachNode(java.util.function.LongPredicate consumer)Iterate over each nodeIdvoidforEachNodeLabel(long mappedNodeId, IdMap.NodeLabelConsumer consumer)booleanhasLabel(long mappedNodeId, org.neo4j.gds.NodeLabel label)longhighestNeoId()longnodeCount()Number of mapped nodeIds.java.util.PrimitiveIterator.OfLongnodeIterator()java.util.PrimitiveIterator.OfLongnodeIterator(java.util.Set<org.neo4j.gds.NodeLabel> labels)java.util.List<org.neo4j.gds.NodeLabel>nodeLabels(long mappedNodeId)IdMaprootIdMap()Returns the original node mapping if the current node mapping is filtered, otherwise it returns itself.java.util.OptionalLongrootNodeCount()Number of mapped node ids in the root mapping.longtoMappedNodeId(long originalNodeId)Maps an original node id to a mapped node id.longtoOriginalNodeId(long mappedNodeId)Map mapped nodeId back to neo4j nodeIdlongtoRootNodeId(long mappedNodeId)Maps a filtered mapped node id to its root mapped node id.java.util.Optional<? extends FilteredIdMap>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:
batchIterablesin interfaceBatchNodeIterable- Returns:
- a collection of iterables over every node, partitioned by the given batch size.
-
toMappedNodeId
public long toMappedNodeId(long originalNodeId)
Description copied from interface:PartialIdMapMaps an original node id to a mapped node id. In case of nested id maps, the mapped node id is always in the space of the innermost mapping.- Specified by:
toMappedNodeIdin interfacePartialIdMap- Parameters:
originalNodeId- must be smaller or equal to the id returned byIdMap.highestNeoId()
-
toOriginalNodeId
public long toOriginalNodeId(long mappedNodeId)
Description copied from interface:IdMapMap mapped nodeId back to neo4j nodeId- Specified by:
toOriginalNodeIdin interfaceIdMap
-
toRootNodeId
public long toRootNodeId(long mappedNodeId)
Description copied from interface:IdMapMaps a filtered mapped node id to its root mapped node id. This is necessary for nested (filtered) id mappings. If this mapping is a nested mapping, this method returns the root mapped node id of the parent mapping. For the root mapping this method returns the given node id.- Specified by:
toRootNodeIdin interfaceIdMap
-
rootIdMap
public IdMap rootIdMap()
Description copied from interface:IdMapReturns the original node mapping if the current node mapping is filtered, otherwise it returns itself.
-
contains
public boolean contains(long originalNodeId)
Description copied from interface:IdMapReturns true iff the neo4jNodeId is mapped, otherwise false.
-
nodeCount
public long nodeCount()
Description copied from interface:IdMapNumber of mapped nodeIds.
-
rootNodeCount
public java.util.OptionalLong rootNodeCount()
Description copied from interface:PartialIdMapNumber of mapped node ids in the root mapping. This is necessary for nested (filtered) id mappings.- Specified by:
rootNodeCountin interfacePartialIdMap
-
highestNeoId
public long highestNeoId()
- Specified by:
highestNeoIdin interfaceIdMap
-
forEachNode
public void forEachNode(java.util.function.LongPredicate consumer)
Description copied from interface:NodeIteratorIterate over each nodeId- Specified by:
forEachNodein interfaceNodeIterator
-
nodeIterator
public java.util.PrimitiveIterator.OfLong nodeIterator()
- Specified by:
nodeIteratorin interfaceNodeIterator
-
nodeIterator
public java.util.PrimitiveIterator.OfLong nodeIterator(java.util.Set<org.neo4j.gds.NodeLabel> labels)
- Specified by:
nodeIteratorin interfaceNodeIterator
-
nodeLabels
public java.util.List<org.neo4j.gds.NodeLabel> nodeLabels(long mappedNodeId)
- Specified by:
nodeLabelsin interfaceIdMap
-
forEachNodeLabel
public void forEachNodeLabel(long mappedNodeId, IdMap.NodeLabelConsumer consumer)- Specified by:
forEachNodeLabelin interfaceIdMap
-
availableNodeLabels
public java.util.Set<org.neo4j.gds.NodeLabel> availableNodeLabels()
- Specified by:
availableNodeLabelsin interfaceIdMap
-
hasLabel
public boolean hasLabel(long mappedNodeId, org.neo4j.gds.NodeLabel label)
-
withFilteredLabels
public java.util.Optional<? extends FilteredIdMap> withFilteredLabels(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels, int concurrency)
- Specified by:
withFilteredLabelsin interfaceIdMap
-
-