Esempio n. 1
0
            public override Evaluation evaluate(Path path, BranchState state)
            {
                int pathLength = path.Length();

                return(Evaluation.of(pathLength <= _depth, pathLength < _depth));
            }
Esempio n. 2
0
        /// <summary>
        /// An <seealso cref="Evaluator"/> which will return {@code evaluationIfMatch} if <seealso cref="Path.endNode()"/>
        /// for a given path is any of {@code nodes}, else {@code evaluationIfNoMatch}.
        /// </summary>
        /// <param name="evaluationIfMatch">   the <seealso cref="Evaluation"/> to return if the <seealso cref="Path.endNode()"/>
        ///                            is any of the nodes in {@code nodes}. </param>
        /// <param name="evaluationIfNoMatch"> the <seealso cref="Evaluation"/> to return if the <seealso cref="Path.endNode()"/>
        ///                            doesn't match any of the nodes in {@code nodes}. </param>
        /// <param name="possibleEndNodes">    a set of nodes to match to end nodes in paths. </param>
        /// @param <STATE>             the type of the state object. </param>
        /// <returns> an <seealso cref="Evaluator"/> which will return {@code evaluationIfMatch} if
        ///         <seealso cref="Path.endNode()"/> for a given path is any of {@code nodes},
        ///         else {@code evaluationIfNoMatch}. </returns>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public static <STATE> PathEvaluator<STATE> endNodeIs(final Evaluation evaluationIfMatch, final Evaluation evaluationIfNoMatch, org.neo4j.graphdb.Node... possibleEndNodes)
        public static PathEvaluator <STATE> EndNodeIs <STATE>(Evaluation evaluationIfMatch, Evaluation evaluationIfNoMatch, params Node[] possibleEndNodes)
        {
            if (possibleEndNodes.Length == 1)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.graphdb.Node target = possibleEndNodes[0];
                Node target = possibleEndNodes[0];
                return(new PathEvaluator_AdapterAnonymousInnerClass8(evaluationIfMatch, evaluationIfNoMatch, target));
            }

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.Set<org.neo4j.graphdb.Node> endNodes = new java.util.HashSet<>(asList(possibleEndNodes));
            ISet <Node> endNodes = new HashSet <Node>(asList(possibleEndNodes));

            return(new PathEvaluator_AdapterAnonymousInnerClass9(evaluationIfMatch, evaluationIfNoMatch, endNodes));
        }
Esempio n. 3
0
            public override Evaluation evaluate(Path path, BranchState state)
            {
                int length = path.Length();

                return(Evaluation.of(length >= _minDepth && length <= _maxDepth, length < _maxDepth));
            }
Esempio n. 4
0
        /// <summary>
        /// Returns an <seealso cref="Evaluator"/> which compares the type of the last relationship
        /// in a <seealso cref="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
        /// {@code evaluationIfMatch} will be returned, otherwise
        /// {@code evaluationIfNoMatch} will be returned.
        /// </summary>
        /// <param name="evaluationIfMatch">   the <seealso cref="Evaluation"/> to return if the type of the
        ///                            last relationship in the path matches any of the given types. </param>
        /// <param name="evaluationIfNoMatch"> the <seealso cref="Evaluation"/> to return if the type of the
        ///                            last relationship in the path doesn't match any of the given types. </param>
        /// <param name="type">                the (first) type (of possibly many) to match the last relationship
        ///                            in paths with. </param>
        /// <param name="orAnyOfTheseTypes">   additional types to match the last relationship in
        ///                            paths with. </param>
        /// @param <STATE>             the type of the state object. </param>
        /// <returns> an <seealso cref="Evaluator"/> which compares the type of the last relationship
        ///         in a <seealso cref="Path"/> to a given set of relationship types. </returns>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public static <STATE> PathEvaluator<STATE> lastRelationshipTypeIs(final Evaluation evaluationIfMatch, final Evaluation evaluationIfNoMatch, final org.neo4j.graphdb.RelationshipType type, org.neo4j.graphdb.RelationshipType... orAnyOfTheseTypes)
        public static PathEvaluator <STATE> LastRelationshipTypeIs <STATE>(Evaluation evaluationIfMatch, Evaluation evaluationIfNoMatch, RelationshipType type, params RelationshipType[] orAnyOfTheseTypes)
        {
            if (orAnyOfTheseTypes.Length == 0)
            {
                return(new PathEvaluator_AdapterAnonymousInnerClass6(evaluationIfMatch, evaluationIfNoMatch, type));
            }

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.Set<String> expectedTypes = new java.util.HashSet<>();
            ISet <string> expectedTypes = new HashSet <string>();

            expectedTypes.Add(type.Name());
            foreach (RelationshipType otherType in orAnyOfTheseTypes)
            {
                expectedTypes.Add(otherType.Name());
            }

            return(new PathEvaluator_AdapterAnonymousInnerClass7(evaluationIfMatch, evaluationIfNoMatch, expectedTypes));
        }
Esempio n. 5
0
 public override Evaluation evaluate(Path path, BranchState state)
 {
     return(Evaluation.ofIncludes(path.Length() >= _depth));
 }