Class NullGraph

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

    public class NullGraph
    extends java.lang.Object
    implements org.neo4j.graphalgo.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.graphalgo.api.BatchNodeIterable

        org.neo4j.graphalgo.api.BatchNodeIterable.IdIterable, org.neo4j.graphalgo.api.BatchNodeIterable.IdIterator
    • Field Summary

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

        START_NODE_ID
    • Constructor Summary

      Constructors 
      Constructor Description
      NullGraph()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<org.neo4j.graphalgo.NodeLabel> availableNodeLabels()  
      java.util.Set<java.lang.String> availableNodeProperties()  
      java.util.Collection<org.neo4j.graphalgo.core.utils.collection.primitive.PrimitiveLongIterable> batchIterables​(int batchSize)  
      void canRelease​(boolean canRelease)  
      org.neo4j.graphalgo.api.Graph concurrentCopy()  
      boolean contains​(long nodeId)  
      int degree​(long nodeId)  
      int degreeWithoutParallelRelationships​(long nodeId)  
      boolean exists​(long sourceNodeId, long targetNodeId)  
      void forEachNode​(java.util.function.LongPredicate consumer)  
      void forEachRelationship​(long nodeId, double fallbackValue, org.neo4j.graphalgo.api.RelationshipWithPropertyConsumer consumer)  
      void forEachRelationship​(long nodeId, org.neo4j.graphalgo.api.RelationshipConsumer consumer)  
      long getTarget​(long nodeId, long index)  
      boolean hasRelationshipProperty()  
      org.neo4j.graphalgo.api.RelationshipIntersect intersection​(long maxDegree)  
      boolean isEmpty()  
      boolean isMultiGraph()  
      boolean isUndirected()  
      long nodeCount()  
      org.neo4j.graphalgo.core.utils.collection.primitive.PrimitiveLongIterator nodeIterator()  
      java.util.Set<org.neo4j.graphalgo.NodeLabel> nodeLabels​(long nodeId)  
      org.neo4j.graphalgo.api.NodeMapping nodeMapping()  
      org.neo4j.graphalgo.api.NodeProperties nodeProperties​(java.lang.String propertyKey)  
      long relationshipCount()  
      double relationshipProperty​(long sourceNodeId, long targetNodeId)  
      double relationshipProperty​(long sourceNodeId, long targetNodeId, double fallbackValue)  
      void releaseTopology()  
      org.neo4j.graphalgo.api.schema.GraphSchema schema()  
      java.util.stream.Stream<org.neo4j.graphalgo.api.RelationshipCursor> streamRelationships​(long nodeId, double fallbackValue)  
      long toMappedNodeId​(long nodeId)  
      long toOriginalNodeId​(long nodeId)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.neo4j.graphalgo.api.Graph

        intersection, release, releaseProperties
      • Methods inherited from interface org.neo4j.graphalgo.api.IdMapping

        cloneIdMapping
      • Methods inherited from interface org.neo4j.graphalgo.api.NodeMapping

        containsOnlyAllNodesLabel, hasLabel
    • Constructor Detail

      • NullGraph

        public NullGraph()
    • Method Detail

      • isEmpty

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

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

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

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

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

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

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

        public org.neo4j.graphalgo.api.RelationshipIntersect intersection​(long maxDegree)
        Specified by:
        intersection in interface org.neo4j.graphalgo.api.Graph
      • concurrentCopy

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

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

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

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

        public org.neo4j.graphalgo.api.NodeMapping nodeMapping()
        Specified by:
        nodeMapping in interface org.neo4j.graphalgo.api.Graph
      • toMappedNodeId

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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