Class NodeCentricContext<CONFIG extends PregelConfig>
- java.lang.Object
-
- org.neo4j.gds.beta.pregel.context.PregelContext<CONFIG>
-
- org.neo4j.gds.beta.pregel.context.NodeCentricContext<CONFIG>
-
- Direct Known Subclasses:
ComputeContext,InitContext
public abstract class NodeCentricContext<CONFIG extends PregelConfig> extends PregelContext<CONFIG>
-
-
Field Summary
Fields Modifier and Type Field Description protected ComputeStep<CONFIG,?>computeStep-
Fields inherited from class org.neo4j.gds.beta.pregel.context.PregelContext
config
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdegree()Returns the degree (number of relationships) of the currently processed node.voidforEachDistinctNeighbor(long nodeId, java.util.function.LongConsumer targetConsumer)Calls the consumer once for each neighbor of the given node.voidforEachDistinctNeighbor(java.util.function.LongConsumer targetConsumer)Calls the consumer once for each neighbor of the currently processed node.voidforEachNeighbor(long nodeId, java.util.function.LongConsumer targetConsumer)Calls the consumer for each neighbor of the given node.voidforEachNeighbor(java.util.function.LongConsumer targetConsumer)Calls the consumer for each neighbor of the currently processed node.booleanisMultiGraph()Indicates whether the input graph is a multi-graph.longnodeCount()Number of nodes in the input graph.longnodeId()The identifier of the node that is currently processed.longrelationshipCount()Number of relationships in the input graph.voidsetNodeId(long nodeId)Used internally by the framework to set the currently processed node.voidsetNodeValue(java.lang.String key, double value)Sets a node double value for given the node schema key.voidsetNodeValue(java.lang.String key, double[] value)Sets a node long value for given the node schema key.voidsetNodeValue(java.lang.String key, long value)Sets a node long value for given the node schema key.voidsetNodeValue(java.lang.String key, long[] value)Sets a node long value for given the node schema key.-
Methods inherited from class org.neo4j.gds.beta.pregel.context.PregelContext
config
-
-
-
-
Field Detail
-
computeStep
protected final ComputeStep<CONFIG extends PregelConfig,?> computeStep
-
-
Method Detail
-
isMultiGraph
public boolean isMultiGraph()
Description copied from class:PregelContextIndicates whether the input graph is a multi-graph.- Specified by:
isMultiGraphin classPregelContext<CONFIG extends PregelConfig>
-
nodeCount
public long nodeCount()
Description copied from class:PregelContextNumber of nodes in the input graph.- Specified by:
nodeCountin classPregelContext<CONFIG extends PregelConfig>
-
relationshipCount
public long relationshipCount()
Description copied from class:PregelContextNumber of relationships in the input graph.- Specified by:
relationshipCountin classPregelContext<CONFIG extends PregelConfig>
-
setNodeId
public void setNodeId(long nodeId)
Used internally by the framework to set the currently processed node.
-
nodeId
public long nodeId()
The identifier of the node that is currently processed.
-
setNodeValue
public void setNodeValue(java.lang.String key, double value)Sets a node double value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
setNodeValue
public void setNodeValue(java.lang.String key, long value)Sets a node long value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
setNodeValue
public void setNodeValue(java.lang.String key, long[] value)Sets a node long value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
setNodeValue
public void setNodeValue(java.lang.String key, double[] value)Sets a node long value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
degree
public int degree()
Returns the degree (number of relationships) of the currently processed node.
-
forEachNeighbor
public void forEachNeighbor(java.util.function.LongConsumer targetConsumer)
Calls the consumer for each neighbor of the currently processed node.
-
forEachNeighbor
public void forEachNeighbor(long nodeId, java.util.function.LongConsumer targetConsumer)Calls the consumer for each neighbor of the given node.
-
forEachDistinctNeighbor
public void forEachDistinctNeighbor(java.util.function.LongConsumer targetConsumer)
Calls the consumer once for each neighbor of the currently processed node.
-
forEachDistinctNeighbor
public void forEachDistinctNeighbor(long nodeId, java.util.function.LongConsumer targetConsumer)Calls the consumer once for each neighbor of the given node.
-
-