Class SingleCursor<T>

  • Type Parameters:
    T - class of value to return.
    All Implemented Interfaces:
    GridCursor<T>

    public class SingleCursor<T>
    extends Object
    implements GridCursor<T>
    Cursor that holds single value only.
    • Constructor Detail

      • SingleCursor

        public SingleCursor​(T val)
    • Method Detail

      • next

        public boolean next()
        Attempt to move cursor position forward.
        Specified by:
        next in interface GridCursor<T>
        Returns:
        true If we were able to move position of cursor forward.
      • get

        public T get()
              throws IgniteCheckedException
        Note that this implementation violates the contract of GridCusror. It must be "before first" but this implementation handles both cases: "before first" and "on first". Current implementation of SQL with H2 relies on this null for queries like "select max(col) from table". This should be fixed for other SQL engines. https://issues.apache.org/jira/browse/IGNITE-14303.
        Specified by:
        get in interface GridCursor<T>
        Returns:
        Element at current position.
        Throws:
        IgniteCheckedException - If failed.