Class IdMapAdapter

    • Constructor Detail

      • IdMapAdapter

        public IdMapAdapter​(IdMap idMap)
    • Method Detail

      • batchIterables

        public java.util.Collection<org.neo4j.gds.collections.primitive.PrimitiveLongIterable> batchIterables​(long batchSize)
        Specified by:
        batchIterables in interface BatchNodeIterable
        Returns:
        a collection of iterables over every node, partitioned by the given batch size.
      • toMappedNodeId

        public long toMappedNodeId​(long originalNodeId)
        Description copied from interface: PartialIdMap
        Maps 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:
        toMappedNodeId in interface PartialIdMap
        Parameters:
        originalNodeId - must be smaller or equal to the id returned by IdMap.highestOriginalId()
      • toOriginalNodeId

        public long toOriginalNodeId​(long mappedNodeId)
        Description copied from interface: IdMap
        Returns the original node id for the given mapped node id. The original node id is typically the Neo4j node id. This method is guaranteed to always return the Neo4j id, regardless of the given mapped node id refers to a filtered node id space or a regular / unfiltered node id space.
        Specified by:
        toOriginalNodeId in interface IdMap
      • toRootNodeId

        public long toRootNodeId​(long mappedNodeId)
        Description copied from interface: IdMap
        Maps 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:
        toRootNodeId in interface IdMap
      • 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.
        Specified by:
        rootIdMap in interface IdMap
      • containsOriginalId

        public boolean containsOriginalId​(long originalNodeId)
        Description copied from interface: IdMap
        Returns true iff the Neo4j id is mapped, otherwise false.
        Specified by:
        containsOriginalId in interface IdMap
      • nodeCount

        public long nodeCount()
        Description copied from interface: IdMap
        Number of mapped nodeIds.
        Specified by:
        nodeCount in interface IdMap
      • nodeCount

        public long nodeCount​(org.neo4j.gds.NodeLabel nodeLabel)
        Description copied from interface: IdMap
        Number of mapped nodeIds for a specific node label.
        Specified by:
        nodeCount in interface IdMap
      • 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 interface PartialIdMap
      • highestOriginalId

        public long highestOriginalId()
        Description copied from interface: IdMap
        The highest id that is mapped in this id mapping.

        The value is the upper bound of the original node id space.

        Specified by:
        highestOriginalId in interface IdMap
      • forEachNode

        public void forEachNode​(java.util.function.LongPredicate consumer)
        Description copied from interface: NodeIterator
        Iterate over each nodeId
        Specified by:
        forEachNode in interface NodeIterator
      • nodeIterator

        public java.util.PrimitiveIterator.OfLong nodeIterator()
        Specified by:
        nodeIterator in interface NodeIterator
      • nodeIterator

        public java.util.PrimitiveIterator.OfLong nodeIterator​(java.util.Set<org.neo4j.gds.NodeLabel> labels)
        Specified by:
        nodeIterator in interface NodeIterator
      • nodeLabels

        public java.util.List<org.neo4j.gds.NodeLabel> nodeLabels​(long mappedNodeId)
        Specified by:
        nodeLabels in interface IdMap
      • availableNodeLabels

        public java.util.Set<org.neo4j.gds.NodeLabel> availableNodeLabels()
        Specified by:
        availableNodeLabels in interface IdMap
      • hasLabel

        public boolean hasLabel​(long mappedNodeId,
                                org.neo4j.gds.NodeLabel label)
        Specified by:
        hasLabel in interface IdMap
      • addNodeLabel

        public void addNodeLabel​(org.neo4j.gds.NodeLabel nodeLabel)
        Description copied from interface: IdMap
        Adds new node label to the available node labels. The labels is not assigned to any nodes at this point.
        Specified by:
        addNodeLabel in interface IdMap
        Parameters:
        nodeLabel - the node label to add
      • addNodeIdToLabel

        public void addNodeIdToLabel​(long nodeId,
                                     org.neo4j.gds.NodeLabel nodeLabel)
        Description copied from interface: IdMap
        Assigns a node to the given node label.
        Specified by:
        addNodeIdToLabel in interface IdMap
        Parameters:
        nodeId - the node id to assign
        nodeLabel - the node label to which the node will be assigned to
      • withFilteredLabels

        public java.util.Optional<FilteredIdMap> withFilteredLabels​(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels,
                                                                    int concurrency)
        Specified by:
        withFilteredLabels in interface IdMap