Class FilteredLabeledIdMap

    • Constructor Detail

      • FilteredLabeledIdMap

        public FilteredLabeledIdMap​(IdMap originalToRootIdMap,
                                    LabeledIdMap rootToFilteredIdMap)
    • Method Detail

      • 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
      • toRootNodeId

        public long toRootNodeId​(long filteredNodeId)
        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
      • toFilteredNodeId

        public long toFilteredNodeId​(long rootNodeId)
        Description copied from interface: FilteredIdMap
        Maps a root mapped node id to a filtered mapped node id. This is necessary for nested (filtered) id mappings. If this mapping is a nested mapping, this method returns the mapped id corresponding to the mapped id of the parent mapping. For the root mapping this method returns the given node id.
        Specified by:
        toFilteredNodeId in interface FilteredIdMap
      • toOriginalNodeId

        public long toOriginalNodeId​(long filteredNodeId)
        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
      • 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()
      • 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
      • 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
      • containsRootNodeId

        public boolean containsRootNodeId​(long rootNodeId)
        Description copied from interface: FilteredIdMap
        Checks if the rootNodeId (mappedNodeId) is present in the IdMaps mapping information.
        Specified by:
        containsRootNodeId in interface FilteredIdMap
      • 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
      • nodeLabels

        public java.util.List<org.neo4j.gds.NodeLabel> nodeLabels​(long filteredNodeId)
        Specified by:
        nodeLabels in interface IdMap
        Overrides:
        nodeLabels in class LabeledIdMap
      • hasLabel

        public boolean hasLabel​(long filteredNodeId,
                                org.neo4j.gds.NodeLabel label)
        Specified by:
        hasLabel in interface IdMap
        Overrides:
        hasLabel in class LabeledIdMap
      • 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
        Overrides:
        addNodeLabel in class LabeledIdMap
        Parameters:
        nodeLabel - the node label to add
      • addNodeIdToLabel

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