コード例 #1
0
 public override bool Next()
 {
     while (_ids.hasNext())
     {
         if (_client.acceptNode(_ids.next(), (Value[])null))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #2
0
        public override bool AcceptNode(long reference, Value[] values)
        {
            // First filter on these values, which come from the index. Some values will be NO_VALUE, because some indexed values cannot be read back.
            // Those values will have to be read from the store using the propertyCursor and is done in one pass after this loop, if needed.
            int storeLookups = 0;

            if (values == null)
            {
                // values == null effectively means that all values are NO_VALUE so we certainly need the store lookup here
                foreach (IndexQuery filter in _filters)
                {
                    if (filter != null)
                    {
                        storeLookups++;
                    }
                }
            }
            else
            {
                for (int i = 0; i < _filters.Length; i++)
                {
                    IndexQuery filter = _filters[i];
                    if (filter != null)
                    {
                        if (values[i] == NO_VALUE)
                        {
                            storeLookups++;
                        }
                        else if (!filter.AcceptsValue(values[i]))
                        {
                            return(false);
                        }
                    }
                }
            }

            // If there were one or more NO_VALUE values above then open store cursor and read those values from the store,
            // applying the same filtering as above, but with a loop designed to do only a single pass over the store values,
            // because it's the most expensive part.
            if (storeLookups > 0 && !AcceptByStoreFiltering(reference, storeLookups, values))
            {
                return(false);
            }
            return(_target.acceptNode(reference, values));
        }