예제 #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
        }
예제 #2
0
        private void InitToForRange <T1>(IndexQuery.RangePredicate <T1> rangePredicate, KEY treeKeyTo)
        {
            Value toValue = rangePredicate.ToValue();

            if (toValue == Values.NO_VALUE)
            {
                treeKeyTo.initValueAsHighest(ValueGroup.UNKNOWN);
            }
            else
            {
                treeKeyTo.initialize(rangePredicate.ToInclusive() ? long.MaxValue : long.MinValue);
                treeKeyTo.from(toValue);
                treeKeyTo.CompareId = true;
            }
        }
예제 #3
0
        private void InitFromForRange <T1>(IndexQuery.RangePredicate <T1> rangePredicate, KEY treeKeyFrom)
        {
            Value fromValue = rangePredicate.FromValue();

            if (fromValue == Values.NO_VALUE)
            {
                treeKeyFrom.initValueAsLowest(ValueGroup.UNKNOWN);
            }
            else
            {
                treeKeyFrom.initialize(rangePredicate.FromInclusive() ? long.MinValue : long.MaxValue);
                treeKeyFrom.from(fromValue);
                treeKeyFrom.CompareId = true;
            }
        }
예제 #4
0
        private static void InitFromForRange <T1>(IndexQuery.RangePredicate <T1> rangePredicate, StringIndexKey treeKeyFrom)
        {
            Value fromValue = rangePredicate.FromValue();

            if (fromValue == Values.NO_VALUE)
            {
                treeKeyFrom.InitValueAsLowest(ValueGroup.TEXT);
            }
            else
            {
                treeKeyFrom.Initialize(rangePredicate.FromInclusive() ? long.MinValue : long.MaxValue);
                treeKeyFrom.From(fromValue);
                treeKeyFrom.CompareId = true;
            }
        }
예제 #5
0
        private static void InitToForRange <T1>(IndexQuery.RangePredicate <T1> rangePredicate, StringIndexKey treeKeyTo)
        {
            Value toValue = rangePredicate.ToValue();

            if (toValue == Values.NO_VALUE)
            {
                treeKeyTo.InitValueAsHighest(ValueGroup.TEXT);
            }
            else
            {
                treeKeyTo.Initialize(rangePredicate.ToInclusive() ? long.MaxValue : long.MinValue);
                treeKeyTo.From(toValue);
                treeKeyTo.CompareId = true;
            }
        }
예제 #6
0
        internal override bool InitializeRangeForQuery(StringIndexKey treeKeyFrom, StringIndexKey treeKeyTo, IndexQuery[] predicates)
        {
            IndexQuery predicate = predicates[0];

            switch (predicate.Type())
            {
            case exists:
                treeKeyFrom.InitValueAsLowest(ValueGroup.TEXT);
                treeKeyTo.InitValueAsHighest(ValueGroup.TEXT);
                return(false);

            case exact:
                IndexQuery.ExactPredicate exactPredicate = (IndexQuery.ExactPredicate)predicate;
                treeKeyFrom.From(exactPredicate.Value());
                treeKeyTo.From(exactPredicate.Value());
                return(false);

            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);
                return(false);

            case stringPrefix:
                StringPrefixPredicate prefixPredicate = ( StringPrefixPredicate )predicate;
                treeKeyFrom.InitAsPrefixLow(prefixPredicate.prefix());
                treeKeyTo.InitAsPrefixHigh(prefixPredicate.prefix());
                return(false);

            case stringSuffix:
            case stringContains:
                treeKeyFrom.InitValueAsLowest(ValueGroup.TEXT);
                treeKeyTo.InitValueAsHighest(ValueGroup.TEXT);
                return(true);

            default:
                throw new System.ArgumentException("IndexQuery of type " + predicate.Type() + " is not supported.");
            }
        }