public class PathExpanderBuilder extends Object
path expanders.
See PathExpanders for a catalog of common expanders.
| Modifier and Type | Method and Description |
|---|---|
PathExpanderBuilder |
add(RelationshipType type)
Add a pair of
type and Direction.BOTH to the PathExpander configuration. |
PathExpanderBuilder |
add(RelationshipType type,
Direction direction)
Add a pair of
type and direction to the PathExpander configuration. |
PathExpanderBuilder |
addNodeFilter(Predicate<? super Node> filter)
Adds a
Node filter. |
PathExpanderBuilder |
addRelationshipFilter(Predicate<? super Relationship> filter)
Adds a
Relationship filter. |
static PathExpanderBuilder |
allTypes(Direction direction)
A
PathExpanderBuilder seeded with all possible types but restricted to direction. |
static PathExpanderBuilder |
allTypesAndDirections()
A
PathExpanderBuilder that is seeded with all possible relationship types in both
directions. |
<STATE> PathExpander<STATE> |
build()
Produce a
PathExpander from the configuration you have built up. |
static PathExpanderBuilder |
empty()
A
PathExpanderBuilder that follows no relationships. |
static PathExpanderBuilder |
emptyOrderedByType()
A
PathExpanderBuilder that follows no relationships. |
PathExpanderBuilder |
remove(RelationshipType type)
Remove expansion of
type in any direction from the PathExpander configuration. |
public static PathExpanderBuilder empty()
PathExpanderBuilder that follows no relationships. You start with this and use
add(RelationshipType, Direction) to form a restrictive PathExpander with just a few expansion rules
in it.PathExpanderBuilder that follows no relationshipspublic static PathExpanderBuilder emptyOrderedByType()
PathExpanderBuilder that follows no relationships. You start with this and use
add(RelationshipType, Direction) to form a restrictive PathExpander with just a few expansion rules
in it.PathExpanderBuilder that follows no relationshipspublic static PathExpanderBuilder allTypesAndDirections()
PathExpanderBuilder that is seeded with all possible relationship types in both
directions. You start with this and remove types to form a permissive
PathExpander with just a few exceptions in it.PathExpanderBuilder that is seeded with all possible relationship types in both
directionspublic static PathExpanderBuilder allTypes(Direction direction)
PathExpanderBuilder seeded with all possible types but restricted to direction. You start
with this and remove types to form a permissive PathExpander with
just a few exceptions in it.direction - The direction you want to restrict expansions toPathExpanderBuilder seeded with all possible types but restricted to direction.public PathExpanderBuilder add(RelationshipType type)
type and Direction.BOTH to the PathExpander configuration.type - the type to add for expansion in both directionsPathExpanderBuilder with the added expansion of type relationships in both directionspublic PathExpanderBuilder add(RelationshipType type, Direction direction)
type and direction to the PathExpander configuration.type - the type to add for expansiondirection - the direction to restrict the expansion toPathExpanderBuilder with the added expansion of type relationships in the given directionpublic PathExpanderBuilder remove(RelationshipType type)
type in any direction from the PathExpander configuration.
Example: PathExpanderBuilder.allTypesAndDirections().remove(type).add(type, Direction.INCOMING)
would restrict the PathExpander to only follow Direction.INCOMING relationships for type while following any other relationship type in either direction.
type - the type to remove from expansionPathExpanderBuilder with expansion of type relationships removedpublic PathExpanderBuilder addNodeFilter(Predicate<? super Node> filter)
Node filter.filter - a Predicate for filtering nodes.PathExpanderBuilder with the added node filter.public PathExpanderBuilder addRelationshipFilter(Predicate<? super Relationship> filter)
Relationship filter.filter - a Predicate for filtering relationships.PathExpanderBuilder with the added relationship filter.public <STATE> PathExpander<STATE> build()
PathExpander from the configuration you have built up.STATE - the type of the object holding the stateCopyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.