Package org.neo4j.graphdb
Class PathExpanders
java.lang.Object
org.neo4j.graphdb.PathExpanders
A catalog of convenient
PathExpander
factory methods.
Use PathExpanderBuilder
to build specialized PathExpander
s.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <STATE> PathExpander<STATE>
A very permissivePathExpander
that follows any type in any direction.static <STATE> PathExpander<STATE>
An expander forcing constant relationship directionstatic <STATE> PathExpander<STATE>
forDirection
(Direction direction) A very permissivePathExpander
that follows any type indirection
.static <STATE> PathExpander<STATE>
forType
(RelationshipType type) A very permissivePathExpander
that followstype
relationships in any direction.static <STATE> PathExpander<STATE>
forTypeAndDirection
(RelationshipType type, Direction direction) static <STATE> PathExpander<STATE>
forTypesAndDirections
(RelationshipType type1, Direction direction1, RelationshipType type2, Direction direction2, Object... more) static <STATE> PathExpander<STATE>
printingWrapper
(PathExpander<STATE> source) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths.static <STATE> PathExpander<STATE>
printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate.static <STATE> PathExpander<STATE>
printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
.static <STATE> PathExpander<STATE>
printingWrapper
(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor, PrintStream out) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
.static <STATE> PathExpander<STATE>
printingWrapper
(PathExpander<STATE> source, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths using givenPaths.PathDescriptor
.
-
Method Details
-
allTypesAndDirections
A very permissivePathExpander
that follows any type in any direction.- Type Parameters:
STATE
- the type of the object that holds the state- Returns:
- a very permissive
PathExpander
that follows any type in any direction
-
forType
A very permissivePathExpander
that followstype
relationships in any direction.- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
type
- the type of relationships to expand in any direction- Returns:
- a very permissive
PathExpander
that followstype
relationships in any direction
-
forDirection
A very permissivePathExpander
that follows any type indirection
.- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
direction
- the direction to follow relationships in- Returns:
- a very permissive
PathExpander
that follows any type indirection
-
forTypeAndDirection
public static <STATE> PathExpander<STATE> forTypeAndDirection(RelationshipType type, Direction direction) - Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
type
- the type of relationships to followdirection
- the direction to follow relationships in- Returns:
- a very restricted
PathExpander
that followstype
indirection
-
forTypesAndDirections
public static <STATE> PathExpander<STATE> forTypesAndDirections(RelationshipType type1, Direction direction1, RelationshipType type2, Direction direction2, Object... more) - Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
type1
- the type of relationships to follow indirection1
direction1
- the direction to followtype1
relationships intype2
- the type of relationships to follow indirection2
direction2
- the direction to followtype2
relationships inmore
- add moretype
/direction
pairs- Returns:
- a very restricted
PathExpander
that follows only thetype
/direction
pairs that you list
-
forConstantDirectionWithTypes
An expander forcing constant relationship direction- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
types
- types of relationships to follow- Returns:
- a
PathExpander
which enforces constant relationship direction
-
printingWrapper
A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths. All expanded paths will be printed using System.out.- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
source
-PathExpander
to wrap.- Returns:
- A new
PathExpander
.
-
printingWrapper
public static <STATE> PathExpander<STATE> printingWrapper(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate. Will use System.out asPrintStream
.- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
source
-PathExpander
to wrap.pred
-BiFunction
used as predicate for printing expansion.- Returns:
- A new
PathExpander
.
-
printingWrapper
public static <STATE> PathExpander<STATE> printingWrapper(PathExpander<STATE> source, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths using givenPaths.PathDescriptor
. All expanded paths will be printed. Will use System.out asPrintStream
.- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
source
-PathExpander
to wrap.descriptor
-Paths.PathDescriptor
to use when printing paths.- Returns:
- A new
PathExpander
.
-
printingWrapper
public static <STATE> PathExpander<STATE> printingWrapper(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
. Will use System.out asPrintStream
.- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
source
-PathExpander
to wrap.pred
-BiFunction
used as predicate for printing expansion.descriptor
-Paths.PathDescriptor
to use when printing paths.- Returns:
- A new
PathExpander
.
-
printingWrapper
public static <STATE> PathExpander<STATE> printingWrapper(PathExpander<STATE> source, BiFunction<Path, BranchState, Boolean> pred, Paths.PathDescriptor descriptor, PrintStream out) A wrapper that usesPaths.DefaultPathDescriptor
to print expanded paths that fulfillBiFunction
predicate using givenPaths.PathDescriptor
.- Type Parameters:
STATE
- the type of the object that holds the state- Parameters:
source
-PathExpander
to wrap.pred
-BiFunction
used as predicate for printing expansion.descriptor
-Paths.PathDescriptor
to use when printing paths.out
-PrintStream
to use for printing expanded paths- Returns:
- A new
PathExpander
.
-