Enum DBCursor.PositionStrategy

  • All Implemented Interfaces:
    Serializable, Comparable<DBCursor.PositionStrategy>
    Enclosing interface:
    DBCursor<T>

    public static enum DBCursor.PositionStrategy
    extends Enum<DBCursor.PositionStrategy>
    Represents a cursor key positioning strategy. Before reading further it is important to understand that a log is an ordered sequence of records - it's an event queue. New records are always expected and are guaranteed to be greater than existing records. They are therefore always appended to the log.
    • Enum Constant Detail

      • LESS_THAN_OR_EQUAL_TO_KEY

        public static final DBCursor.PositionStrategy LESS_THAN_OR_EQUAL_TO_KEY
        Positions the cursor on the nearest existing key which is less than or equal to the requested key. If the requested key is greater than all keys in the log then the cursor will be positioned so that it points at the last record in the log. Note that new records may be appended to the log after positioning which may be closer or even equal to the requested key.
      • EQUAL_TO_KEY

        public static final DBCursor.PositionStrategy EQUAL_TO_KEY
        Positions the cursor on the requested key if it exists.
      • GREATER_THAN_OR_EQUAL_TO_KEY

        public static final DBCursor.PositionStrategy GREATER_THAN_OR_EQUAL_TO_KEY
        Positions the cursor on the nearest existing key which is greater than or equal to the requested key.
      • GREATER_THAN_KEY

        public static final DBCursor.PositionStrategy GREATER_THAN_KEY
        Positions the cursor on the nearest key which is greater than the requested key. If the requested key corresponds to the last record in the log then positioning succeeds but the cursor points immediately beyond the end of the log (it is exhausted). Any records that are subsequently appended to the log are guaranteed to be greater than the requested key.
    • Method Detail

      • values

        public static DBCursor.PositionStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DBCursor.PositionStrategy c : DBCursor.PositionStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DBCursor.PositionStrategy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null