Beispiel #1
0
        protected internal override bool InitializeRangeForQuery(KEY treeKeyFrom, KEY treeKeyTo, IndexQuery[] predicates)
        {
            IndexQuery predicate = predicates[0];

            switch (predicate.Type())
            {
            case exists:
                treeKeyFrom.initValueAsLowest(ValueGroup.UNKNOWN);
                treeKeyTo.initValueAsHighest(ValueGroup.UNKNOWN);
                break;

            case exact:
                IndexQuery.ExactPredicate exactPredicate = (IndexQuery.ExactPredicate)predicate;
                treeKeyFrom.from(exactPredicate.Value());
                treeKeyTo.from(exactPredicate.Value());
                break;

            case range:
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.neo4j.internal.kernel.api.IndexQuery.RangePredicate<?> rangePredicate = (org.neo4j.internal.kernel.api.IndexQuery.RangePredicate<?>) predicate;
                IndexQuery.RangePredicate <object> rangePredicate = (IndexQuery.RangePredicate <object>)predicate;
                InitFromForRange(rangePredicate, treeKeyFrom);
                InitToForRange(rangePredicate, treeKeyTo);
                break;

            default:
                throw new System.ArgumentException("IndexQuery of type " + predicate.Type() + " is not supported.");
            }
            return(false);              // no filtering
        }
Beispiel #2
0
 private static bool IsNumericOrGeometricPredicate(IndexQuery predicate)
 {
     if (predicate.Type() == IndexQuery.IndexQueryType.exact)
     {
         IndexQuery.ExactPredicate exactPredicate = (IndexQuery.ExactPredicate)predicate;
         return(IsNumberGeometryOrArray(exactPredicate.Value()));
     }
     else
     {
         return(predicate.Type() == IndexQuery.IndexQueryType.range && (predicate.ValueGroup() == ValueGroup.NUMBER || predicate.ValueGroup() == ValueGroup.GEOMETRY));
     }
 }