Class NullGraph

  • All Implemented Interfaces:
    org.neo4j.gds.api.BatchNodeIterable, org.neo4j.gds.api.Degrees, org.neo4j.gds.api.Graph, org.neo4j.gds.api.IdMapping, org.neo4j.gds.api.NodeIterator, org.neo4j.gds.api.NodeMapping, org.neo4j.gds.api.NodePropertyContainer, org.neo4j.gds.api.RelationshipAccess, org.neo4j.gds.api.RelationshipIterator, org.neo4j.gds.api.RelationshipPredicate, org.neo4j.gds.api.RelationshipProperties

    public class NullGraph
    extends java.lang.Object
    implements org.neo4j.gds.api.Graph
    The NullGraph is used for non-product algos that don't use a graph. It makes it a bit easier to adapt those algorithms to the new API, as we can override graph creation and inject a NullGraph.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.neo4j.gds.api.BatchNodeIterable

        org.neo4j.gds.api.BatchNodeIterable.IdIterable, org.neo4j.gds.api.BatchNodeIterable.IdIterator
      • Nested classes/interfaces inherited from interface org.neo4j.gds.api.NodeMapping

        org.neo4j.gds.api.NodeMapping.NodeLabelConsumer
    • Field Summary

      • Fields inherited from interface org.neo4j.gds.api.IdMapping

        NOT_FOUND, START_NODE_ID
    • Constructor Summary

      Constructors 
      Constructor Description
      NullGraph()  
    • Constructor Detail

      • NullGraph

        public NullGraph()
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface org.neo4j.gds.api.Graph
      • releaseTopology

        public void releaseTopology()
        Specified by:
        releaseTopology in interface org.neo4j.gds.api.Graph
      • relationshipCount

        public long relationshipCount()
        Specified by:
        relationshipCount in interface org.neo4j.gds.api.Graph
      • isUndirected

        public boolean isUndirected()
        Specified by:
        isUndirected in interface org.neo4j.gds.api.Graph
      • isMultiGraph

        public boolean isMultiGraph()
        Specified by:
        isMultiGraph in interface org.neo4j.gds.api.Graph
      • hasRelationshipProperty

        public boolean hasRelationshipProperty()
        Specified by:
        hasRelationshipProperty in interface org.neo4j.gds.api.Graph
      • canRelease

        public void canRelease​(boolean canRelease)
        Specified by:
        canRelease in interface org.neo4j.gds.api.Graph
      • concurrentCopy

        public org.neo4j.gds.api.Graph concurrentCopy()
        Specified by:
        concurrentCopy in interface org.neo4j.gds.api.Graph
        Specified by:
        concurrentCopy in interface org.neo4j.gds.api.RelationshipIterator
      • batchIterables

        public java.util.Collection<org.neo4j.gds.core.utils.collection.primitive.PrimitiveLongIterable> batchIterables​(long batchSize)
        Specified by:
        batchIterables in interface org.neo4j.gds.api.BatchNodeIterable
      • degree

        public int degree​(long nodeId)
        Specified by:
        degree in interface org.neo4j.gds.api.Degrees
      • degreeWithoutParallelRelationships

        public int degreeWithoutParallelRelationships​(long nodeId)
        Specified by:
        degreeWithoutParallelRelationships in interface org.neo4j.gds.api.Degrees
      • toMappedNodeId

        public long toMappedNodeId​(long nodeId)
        Specified by:
        toMappedNodeId in interface org.neo4j.gds.api.IdMapping
      • toOriginalNodeId

        public long toOriginalNodeId​(long nodeId)
        Specified by:
        toOriginalNodeId in interface org.neo4j.gds.api.IdMapping
      • toRootNodeId

        public long toRootNodeId​(long nodeId)
        Specified by:
        toRootNodeId in interface org.neo4j.gds.api.IdMapping
      • rootNodeMapping

        public org.neo4j.gds.api.NodeMapping rootNodeMapping()
        Specified by:
        rootNodeMapping in interface org.neo4j.gds.api.NodeMapping
      • highestNeoId

        public long highestNeoId()
        Specified by:
        highestNeoId in interface org.neo4j.gds.api.IdMapping
      • contains

        public boolean contains​(long nodeId)
        Specified by:
        contains in interface org.neo4j.gds.api.IdMapping
      • nodeCount

        public long nodeCount()
        Specified by:
        nodeCount in interface org.neo4j.gds.api.IdMapping
      • rootNodeCount

        public long rootNodeCount()
        Specified by:
        rootNodeCount in interface org.neo4j.gds.api.IdMapping
      • forEachNode

        public void forEachNode​(java.util.function.LongPredicate consumer)
        Specified by:
        forEachNode in interface org.neo4j.gds.api.NodeIterator
      • nodeIterator

        public org.neo4j.gds.core.utils.collection.primitive.PrimitiveLongIterator nodeIterator()
        Specified by:
        nodeIterator in interface org.neo4j.gds.api.NodeIterator
      • nodeLabels

        public java.util.Set<org.neo4j.gds.NodeLabel> nodeLabels​(long nodeId)
        Specified by:
        nodeLabels in interface org.neo4j.gds.api.NodeMapping
      • forEachNodeLabel

        public void forEachNodeLabel​(long nodeId,
                                     org.neo4j.gds.api.NodeMapping.NodeLabelConsumer consumer)
        Specified by:
        forEachNodeLabel in interface org.neo4j.gds.api.NodeMapping
      • availableNodeLabels

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

        public boolean hasLabel​(long nodeId,
                                org.neo4j.gds.NodeLabel label)
        Specified by:
        hasLabel in interface org.neo4j.gds.api.NodeMapping
      • schema

        public org.neo4j.gds.api.schema.GraphSchema schema()
        Specified by:
        schema in interface org.neo4j.gds.api.Graph
      • nodeProperties

        public org.neo4j.gds.api.NodeProperties nodeProperties​(java.lang.String propertyKey)
        Specified by:
        nodeProperties in interface org.neo4j.gds.api.NodePropertyContainer
      • availableNodeProperties

        public java.util.Set<java.lang.String> availableNodeProperties()
        Specified by:
        availableNodeProperties in interface org.neo4j.gds.api.NodePropertyContainer
      • getTarget

        public long getTarget​(long nodeId,
                              long index)
        Specified by:
        getTarget in interface org.neo4j.gds.api.RelationshipAccess
      • forEachRelationship

        public void forEachRelationship​(long nodeId,
                                        org.neo4j.gds.api.RelationshipConsumer consumer)
        Specified by:
        forEachRelationship in interface org.neo4j.gds.api.RelationshipIterator
      • forEachRelationship

        public void forEachRelationship​(long nodeId,
                                        double fallbackValue,
                                        org.neo4j.gds.api.RelationshipWithPropertyConsumer consumer)
        Specified by:
        forEachRelationship in interface org.neo4j.gds.api.RelationshipIterator
      • streamRelationships

        public java.util.stream.Stream<org.neo4j.gds.api.RelationshipCursor> streamRelationships​(long nodeId,
                                                                                                 double fallbackValue)
        Specified by:
        streamRelationships in interface org.neo4j.gds.api.RelationshipIterator
      • relationshipTypeFilteredGraph

        public org.neo4j.gds.api.Graph relationshipTypeFilteredGraph​(java.util.Set<org.neo4j.gds.RelationshipType> relationshipTypes)
        Specified by:
        relationshipTypeFilteredGraph in interface org.neo4j.gds.api.Graph
      • exists

        public boolean exists​(long sourceNodeId,
                              long targetNodeId)
        Specified by:
        exists in interface org.neo4j.gds.api.RelationshipPredicate
      • relationshipProperty

        public double relationshipProperty​(long sourceNodeId,
                                           long targetNodeId,
                                           double fallbackValue)
        Specified by:
        relationshipProperty in interface org.neo4j.gds.api.RelationshipProperties
      • relationshipProperty

        public double relationshipProperty​(long sourceNodeId,
                                           long targetNodeId)
        Specified by:
        relationshipProperty in interface org.neo4j.gds.api.RelationshipProperties