Class Cursors


  • public class Cursors
    extends java.lang.Object
    This utility class provides factory methods to create commonly used types of Cursors.
    • Method Detail

      • checkMemoryLimit

        public static void checkMemoryLimit​(long count,
                                            QueryLimits settings)
      • checkReadLimit

        public static void checkReadLimit​(long count,
                                          QueryLimits settings)
      • newConcatCursor

        public static Cursor newConcatCursor​(java.util.List<Cursor> cursors,
                                             QueryLimits settings)
      • newPathCursor

        public static Cursor newPathCursor​(java.lang.Iterable<java.lang.String> paths,
                                           QueryLimits settings)
        Creates a Cursor over paths.
        Parameters:
        paths - the paths to iterate over (must return distinct paths)
        Returns:
        the Cursor.
      • newPathCursorDistinct

        public static Cursor newPathCursorDistinct​(java.lang.Iterable<java.lang.String> paths,
                                                   QueryLimits settings)
        Creates a Cursor over paths, and make the result distinct. The iterator might return duplicate paths
        Parameters:
        paths - the paths to iterate over (might contain duplicate entries)
        Returns:
        the Cursor.
      • newTraversingCursor

        public static Cursor newTraversingCursor​(Filter filter,
                                                 NodeState rootState)
        Returns a traversing cursor based on the path restriction in the given Filter.
        Parameters:
        filter - the filter.
        rootState - the root NodeState.
        Returns:
        the Cursor.
      • newAncestorCursor

        public static Cursor newAncestorCursor​(Cursor c,
                                               int level,
                                               QueryLimits settings)
        Returns a cursor wrapper, which returns the ancestor rows at the given level of the wrapped cursor c. With level e.g. set to 1, the returned cursor iterates over the parent rows of the passed cursor c. The returned cursor guarantees distinct rows.
        Parameters:
        c - the cursor to wrap.
        level - the ancestor level. Must be >= 1.
        Returns:
        cursor over the ancestors of c at level.