Class NodeCentricContext<CONFIG extends PregelConfig>
- java.lang.Object
-
- org.neo4j.graphalgo.beta.pregel.context.PregelContext<CONFIG>
-
- org.neo4j.graphalgo.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.graphalgo.beta.pregel.context.PregelContext
config
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
degree()
Returns the degree (number of relationships) of the currently processed node.void
forEachDistinctNeighbor(long nodeId, java.util.function.LongConsumer targetConsumer)
Calls the consumer once for each neighbor of the given node.void
forEachDistinctNeighbor(java.util.function.LongConsumer targetConsumer)
Calls the consumer once for each neighbor of the currently processed node.void
forEachNeighbor(long nodeId, java.util.function.LongConsumer targetConsumer)
Calls the consumer for each neighbor of the given node.void
forEachNeighbor(java.util.function.LongConsumer targetConsumer)
Calls the consumer for each neighbor of the currently processed node.boolean
isMultiGraph()
Indicates whether the input graph is a multi-graph.long
nodeCount()
Number of nodes in the input graph.long
nodeId()
The identifier of the node that is currently processed.long
relationshipCount()
Number of relationships in the input graph.void
setNodeId(long nodeId)
Used internally by the framework to set the currently processed node.void
setNodeValue(java.lang.String key, double value)
Sets a node double value for given the node schema key.void
setNodeValue(java.lang.String key, double[] value)
Sets a node long value for given the node schema key.void
setNodeValue(java.lang.String key, long value)
Sets a node long value for given the node schema key.void
setNodeValue(java.lang.String key, long[] value)
Sets a node long value for given the node schema key.-
Methods inherited from class org.neo4j.graphalgo.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:PregelContext
Indicates whether the input graph is a multi-graph.- Specified by:
isMultiGraph
in classPregelContext<CONFIG extends PregelConfig>
-
nodeCount
public long nodeCount()
Description copied from class:PregelContext
Number of nodes in the input graph.- Specified by:
nodeCount
in classPregelContext<CONFIG extends PregelConfig>
-
relationshipCount
public long relationshipCount()
Description copied from class:PregelContext
Number of relationships in the input graph.- Specified by:
relationshipCount
in 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.
-
-