/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} to print expanded paths * using given {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor}. * All expanded paths will be printed. * Will use System.out as {@link PrintStream}. * @param source {@link PathExpander} to wrap. * @param descriptor {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor} to use when printing paths. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source, final Paths.PathDescriptor descriptor ) { return printingWrapper( source, ( propertyContainers, stateBranchState ) -> Boolean.TRUE, descriptor ); }
/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} to print expanded paths * that fulfill {@link BiFunction} predicate using given {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor}. * Will use System.out as {@link PrintStream}. * @param source {@link PathExpander} to wrap. * @param pred {@link BiFunction} used as predicate for printing expansion. * @param descriptor {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor} to use when printing paths. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source, final BiFunction<Path, BranchState, Boolean> pred, final Paths.PathDescriptor descriptor ) { return printingWrapper( source, pred, descriptor, System.out ); }
/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} to print expanded paths. * All expanded paths will be printed using System.out. * @param source {@link PathExpander} to wrap. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source ) { return printingWrapper( source, new Paths.DefaultPathDescriptor() ); }
@Override public PathExpander<STATE> reverse() { return printingWrapper( source.reverse(), pred, descriptor, out ); } };
/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} * to print expanded paths that fulfill {@link BiFunction} predicate. * Will use System.out as {@link PrintStream}. * @param source {@link PathExpander} to wrap. * @param pred {@link BiFunction} used as predicate for printing expansion. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source, final BiFunction<Path, BranchState, Boolean> pred ) { return printingWrapper( source, pred, new Paths.DefaultPathDescriptor() ); }
/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} to print expanded paths * that fulfill {@link BiFunction} predicate using given {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor}. * Will use System.out as {@link PrintStream}. * @param source {@link PathExpander} to wrap. * @param pred {@link BiFunction} used as predicate for printing expansion. * @param descriptor {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor} to use when printing paths. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source, final BiFunction<Path, BranchState, Boolean> pred, final Paths.PathDescriptor descriptor ) { return printingWrapper( source, pred, descriptor, System.out ); }
/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} to print expanded paths * using given {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor}. * All expanded paths will be printed. * Will use System.out as {@link PrintStream}. * @param source {@link PathExpander} to wrap. * @param descriptor {@link org.neo4j.graphdb.traversal.Paths.PathDescriptor} to use when printing paths. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source, final Paths.PathDescriptor descriptor ) { return printingWrapper( source, ( propertyContainers, stateBranchState ) -> Boolean.TRUE, descriptor ); }
@Override public PathExpander<STATE> reverse() { return printingWrapper( source.reverse(), pred, descriptor, out ); } };
/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} to print expanded paths. * All expanded paths will be printed using System.out. * @param source {@link PathExpander} to wrap. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source ) { return printingWrapper( source, new Paths.DefaultPathDescriptor() ); }
/** * A wrapper that uses {@link org.neo4j.graphdb.traversal.Paths.DefaultPathDescriptor} * to print expanded paths that fulfill {@link BiFunction} predicate. * Will use System.out as {@link PrintStream}. * @param source {@link PathExpander} to wrap. * @param pred {@link BiFunction} used as predicate for printing expansion. * @param <STATE> the type of the object that holds the state * @return A new {@link PathExpander}. */ public static <STATE> PathExpander<STATE> printingWrapper( final PathExpander<STATE> source, final BiFunction<Path, BranchState, Boolean> pred ) { return printingWrapper( source, pred, new Paths.DefaultPathDescriptor() ); }