/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.jackrabbit.oak.spi.query;

/**
 * A cursor to read a number of nodes sequentially.
 */
public interface Cursor {

    /**
     * Skip to the next node if one is available.
     *
     * @return true if another row is available
     */
    boolean next();

    /**
     * The current row within this index. The row usually only contains the
     * path, but it may additionally contain so-called 'pseudo-properties' such
     * as "jcr:score" and "rep:excerpt", in case the index supports those
     * properties and if the properties were requested when running the query.
     *
     * @return the row
     */
    IndexRow currentRow();

}

@@ -1125,16 +1125,34 @@
 s index.
+%0A     * %3Cp%3E%0A     *
  The row
@@ -1156,14 +1156,10 @@
 row 
-usuall
+ma
 y on
@@ -1177,45 +1177,67 @@
  the
-%0A     * path, but it may additionally
+ path, if a path is available. It may also%0A     * (or just)
  con
@@ -1251,17 +1251,17 @@
 -called 
-'
+%22
 pseudo-p
@@ -1273,21 +1273,14 @@
 ties
-'
+%22
  such
-%0A     *
  as 
@@ -1294,16 +1294,23 @@
 ore%22 and
+%0A     *
  %22rep:ex
@@ -1353,94 +1353,1012 @@
 hose
-%0A     * properties and if the properties were requested when running the query
+ properties and if the%0A     * properties were requested when running the query. The query engine will%0A     * indicate that those pseudo properties were requested by setting an%0A     * appropriate (possibly unrestricted) filter condition.%0A     * %3Cp%3E%0A     * The index should return a row with those properties that are stored in%0A     * the index itself, so that the query engine doesn't have to load the whole%0A     * row / node unnecessarily (avoiding to load the whole row is sometimes%0A     * called %22index only scan%22), specially for rows that are anyway skipped. If%0A     * the index does not have an (efficient) way to return some (or any) of the%0A     * properties, it doesn't have to provide those values. In this case, the%0A     * query engine will load the node itself if required. If all conditions%0A     * match, the query engine will sometimes load the node to do access checks,%0A     * but this is not always the case, and it is not the case if any of the%0A     * (join) conditions do not match
 .%0A     *
 %0A   
@@ -2345,32 +2345,33 @@
 ot match.%0A     *
+ 
 %0A     * @return 

OAK-34 Define query API (javadocs)