public class RandomRelationshipSelector extends Object implements RelationshipSelector
RelationshipSelector that selects a Relationship at random from all the given
Node's Relationships, such that match the selected
Relationship matches the provided RelationshipInclusionPolicy.
This is an O(n) algorithm.| Constructor and Description |
|---|
RandomRelationshipSelector()
Constructs a new
RandomRelationshipSelector that selects any relationship that isn't
framework-internal and doesn't link to a framework-internal node. |
RandomRelationshipSelector(RelationshipInclusionPolicy relationshipInclusionPolicy)
Constructs a new
RandomRelationshipSelector that chooses relationships in accordance with the given
ObjectInclusionPolicy. |
| Modifier and Type | Method and Description |
|---|---|
org.neo4j.graphdb.Relationship |
selectRelationship(org.neo4j.graphdb.Node node)
Select a relationship of the node.
|
public RandomRelationshipSelector()
RandomRelationshipSelector that selects any relationship that isn't
framework-internal and doesn't link to a framework-internal node.public RandomRelationshipSelector(RelationshipInclusionPolicy relationshipInclusionPolicy)
RandomRelationshipSelector that chooses relationships in accordance with the given
ObjectInclusionPolicy.relationshipInclusionPolicy - The ObjectInclusionPolicy used to select relationships to follow.public org.neo4j.graphdb.Relationship selectRelationship(org.neo4j.graphdb.Node node)
selectRelationship in interface RelationshipSelectornode - for which to select a relationship.Relationship of the given node, null if a relationship can't be selected
for whatever reason, perhaps because the node has no (matching) relationships.Copyright © 2013-2016–2018 Graph Aware Limited. All rights reserved.