public abstract class Evaluators extends Object
Evaluator
s useful during common traversals.Evaluator
,
TraversalDescription
Constructor and Description |
---|
Evaluators() |
Modifier and Type | Method and Description |
---|---|
static <STATE> PathEvaluator<STATE> |
all() |
static <STATE> PathEvaluator<STATE> |
atDepth(int depth)
Returns an
Evaluator which only includes positions at depth
and prunes everything deeper than that. |
static <STATE> PathEvaluator<STATE> |
endNodeIs(Evaluation evaluationIfMatch,
Evaluation evaluationIfNoMatch,
Node... possibleEndNodes)
An
Evaluator which will return evaluationIfMatch if Path.endNode()
for a given path is any of nodes , else evaluationIfNoMatch . |
static <STATE> PathEvaluator<STATE> |
endNodeIsAtDepth(int depth,
Node... possibleEndNodes)
Returns
Evaluator s for paths with the specified depth and with an end node from the list of
possibleEndNodes. |
static PathEvaluator |
excludeStartPosition() |
static <STATE> PathEvaluator<STATE> |
fromDepth(int depth)
Returns an
Evaluator which only includes positions from depth
and deeper and never prunes anything. |
static <STATE> PathEvaluator<STATE> |
includeIfAcceptedByAny(Evaluator... evaluators)
Whereas adding
Evaluator s to a TraversalDescription puts those
evaluators in AND-mode this can group many evaluators in OR-mode . |
static <STATE> PathEvaluator<STATE> |
includeIfAcceptedByAny(PathEvaluator... evaluators)
Whereas adding
Evaluator s to a TraversalDescription puts those
evaluators in AND-mode this can group many evaluators in OR-mode . |
static <STATE> PathEvaluator<STATE> |
includeIfContainsAll(Node... nodes)
Evaluator which decides to include a
Path if all the
nodes exist in it. |
static <STATE> PathEvaluator<STATE> |
includeWhereEndNodeIs(Node... nodes)
Include paths with the specified end nodes.
|
static <STATE> PathEvaluator<STATE> |
includeWhereLastRelationshipTypeIs(RelationshipType type,
RelationshipType... orAnyOfTheseTypes) |
static <STATE> PathEvaluator<STATE> |
includingDepths(int minDepth,
int maxDepth)
|
static <STATE> PathEvaluator<STATE> |
lastRelationshipTypeIs(Evaluation evaluationIfMatch,
Evaluation evaluationIfNoMatch,
RelationshipType type,
RelationshipType... orAnyOfTheseTypes)
|
static <STATE> PathEvaluator<STATE> |
pruneWhereEndNodeIs(Node... nodes) |
static <STATE> PathEvaluator<STATE> |
pruneWhereLastRelationshipTypeIs(RelationshipType type,
RelationshipType... orAnyOfTheseTypes) |
static <STATE> PathEvaluator<STATE> |
toDepth(int depth)
Returns an
Evaluator which includes positions down to depth
and prunes everything deeper than that. |
public static <STATE> PathEvaluator<STATE> all()
STATE
- the type of the state object.public static PathEvaluator excludeStartPosition()
public static <STATE> PathEvaluator<STATE> toDepth(int depth)
Evaluator
which includes positions down to depth
and prunes everything deeper than that.STATE
- the type of the state object.depth
- the max depth to traverse to.Evaluator
which includes positions down to
depth
and prunes everything deeper than that.public static <STATE> PathEvaluator<STATE> fromDepth(int depth)
Evaluator
which only includes positions from depth
and deeper and never prunes anything.STATE
- the type of the state object.depth
- the depth to start include positions from.Evaluator
which only includes positions from
depth
and deeper and never prunes anything.public static <STATE> PathEvaluator<STATE> atDepth(int depth)
Evaluator
which only includes positions at depth
and prunes everything deeper than that.STATE
- the type of the state object.depth
- the depth to start include positions from.Evaluator
which only includes positions at
depth
and prunes everything deeper than that.public static <STATE> PathEvaluator<STATE> includingDepths(int minDepth, int maxDepth)
Evaluator
which only includes positions between
depths minDepth
and maxDepth
. It prunes everything deeper
than maxDepth
.STATE
- the type of the state object.minDepth
- minimum depth a position must have to be included.maxDepth
- maximum depth a position must have to be included.Evaluator
which only includes positions between
depths minDepth
and maxDepth
. It prunes everything deeper
than maxDepth
.public static <STATE> PathEvaluator<STATE> lastRelationshipTypeIs(Evaluation evaluationIfMatch, Evaluation evaluationIfNoMatch, RelationshipType type, RelationshipType... orAnyOfTheseTypes)
Evaluator
which compares the type of the last relationship
in a Path
to a given set of relationship types (one or more).If the type of
the last relationship in a path is of one of the given types then
evaluationIfMatch
will be returned, otherwise
evaluationIfNoMatch
will be returned.STATE
- the type of the state object.evaluationIfMatch
- the Evaluation
to return if the type of the
last relationship in the path matches any of the given types.evaluationIfNoMatch
- the Evaluation
to return if the type of the
last relationship in the path doesn't match any of the given types.type
- the (first) type (of possibly many) to match the last relationship
in paths with.orAnyOfTheseTypes
- additional types to match the last relationship in
paths with.Evaluator
which compares the type of the last relationship
in a Path
to a given set of relationship types.public static <STATE> PathEvaluator<STATE> includeWhereLastRelationshipTypeIs(RelationshipType type, RelationshipType... orAnyOfTheseTypes)
STATE
- the type of the state object.type
- the (first) type (of possibly many) to match the last relationship
in paths with.orAnyOfTheseTypes
- types to match the last relationship in paths with. If any matches
it's considered a match.Evaluator
which compares the type of the last relationship
in a Path
to a given set of relationship types.Uses {@link Evaluation#INCLUDE_AND_CONTINUE} for {@code evaluationIfMatch}
and {@link Evaluation#EXCLUDE_AND_CONTINUE} for {@code evaluationIfNoMatch}.
public static <STATE> PathEvaluator<STATE> pruneWhereLastRelationshipTypeIs(RelationshipType type, RelationshipType... orAnyOfTheseTypes)
STATE
- the type of the state object.type
- the (first) type (of possibly many) to match the last relationship
in paths with.orAnyOfTheseTypes
- types to match the last relationship in paths with. If any matches
it's considered a match.Evaluator
which compares the type of the last relationship
in a Path
to a given set of relationship types.Uses {@link Evaluation#INCLUDE_AND_PRUNE} for {@code evaluationIfMatch}
and {@link Evaluation#INCLUDE_AND_CONTINUE} for {@code evaluationIfNoMatch}.
public static <STATE> PathEvaluator<STATE> endNodeIs(Evaluation evaluationIfMatch, Evaluation evaluationIfNoMatch, Node... possibleEndNodes)
Evaluator
which will return evaluationIfMatch
if Path.endNode()
for a given path is any of nodes
, else evaluationIfNoMatch
.STATE
- the type of the state object.evaluationIfMatch
- the Evaluation
to return if the Path.endNode()
is any of the nodes in nodes
.evaluationIfNoMatch
- the Evaluation
to return if the Path.endNode()
doesn't match any of the nodes in nodes
.possibleEndNodes
- a set of nodes to match to end nodes in paths.Evaluator
which will return evaluationIfMatch
if
Path.endNode()
for a given path is any of nodes
,
else evaluationIfNoMatch
.public static <STATE> PathEvaluator<STATE> includeWhereEndNodeIs(Node... nodes)
Evaluation.INCLUDE_AND_CONTINUE
for evaluationIfMatch
and
Evaluation.EXCLUDE_AND_CONTINUE
for evaluationIfNoMatch
.STATE
- the type of the state object.nodes
- end nodes for paths to be included in the result.nodes
public static <STATE> PathEvaluator<STATE> pruneWhereEndNodeIs(Node... nodes)
public static <STATE> PathEvaluator<STATE> includeIfContainsAll(Node... nodes)
Path
if all the
nodes
exist in it.STATE
- the type of the state object.nodes
- Node
s that must exist in a Path
for it
to be included.Evaluation.INCLUDE_AND_CONTINUE
if all nodes
exist in a given Path
, otherwise
Evaluation.EXCLUDE_AND_CONTINUE
.public static <STATE> PathEvaluator<STATE> includeIfAcceptedByAny(PathEvaluator... evaluators)
Evaluator
s to a TraversalDescription
puts those
evaluators in AND-mode
this can group many evaluators in OR-mode
.STATE
- the type of the state object.evaluators
- represented as one evaluators. If any of the evaluators decides
to include a path it will be included.Evaluator
which decides to include a path if any of the supplied
evaluators wants to include it.public static <STATE> PathEvaluator<STATE> includeIfAcceptedByAny(Evaluator... evaluators)
Evaluator
s to a TraversalDescription
puts those
evaluators in AND-mode
this can group many evaluators in OR-mode
.STATE
- the type of the state object.evaluators
- represented as one evaluators. If any of the evaluators decides
to include a path it will be included.Evaluator
which decides to include a path if any of the supplied
evaluators wants to include it.public static <STATE> PathEvaluator<STATE> endNodeIsAtDepth(int depth, Node... possibleEndNodes)
Evaluator
s for paths with the specified depth and with an end node from the list of
possibleEndNodes.STATE
- the type of the state object.depth
- The exact depth to filter the returned path evaluators.possibleEndNodes
- Filter for the possible nodes to end the path on.Evaluator
s for paths with the specified depth and with an end node from the list of
possibleEndNodes.Copyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.