| | |
| | | * } |
| | | * </pre> |
| | | * |
| | | * A cursor can be initialised from a key, using a {@code KeyMatchingStrategy} and |
| | | * a {@code PositionStrategy}, to determine the exact starting position. |
| | | * <p> |
| | | * Let's call Kp the highest key lower than K and Kn the lowest key higher |
| | | * than K : Kp < K < Kn |
| | | * <ul> |
| | | * <li>When using EQUAL_TO_KEY on key K : |
| | | * <ul> |
| | | * <li>with ON_MATCHING_KEY, cursor is positioned on key K (if K exists in log), |
| | | * otherwise it is empty</li> |
| | | * <li>with AFTER_MATCHING_KEY, cursor is positioned on key Kn (if K exists in log), |
| | | * otherwise it is empty</li> |
| | | * </ul> |
| | | * </li> |
| | | * <li>When using LESS_THAN_OR_EQUAL_TO_KEY on key K : |
| | | * <ul> |
| | | * <li>with ON_MATCHING_KEY, cursor is positioned on key K (if K exists in log) |
| | | * or else Kp (if Kp exists in log), otherwise it is empty</li> |
| | | * <li>with AFTER_MATCHING_KEY, cursor is positioned on key Kn (if Kp or K exist in log), |
| | | * otherwise it is empty</li> |
| | | * </ul> |
| | | * </li> |
| | | * <li>When using GREATER_THAN_OR_EQUAL_TO_KEY on key K : |
| | | * <ul> |
| | | * <li>with ON_MATCHING_KEY, cursor is positioned on key K (if K exists in log) |
| | | * or else Kn (if Kn exists in log), otherwise it is empty</li> |
| | | * <li>with AFTER_MATCHING_KEY, cursor is positioned on key Kn (if K or Kn exist in log), |
| | | * otherwise it is empty</li> |
| | | * </ul> |
| | | * </li> |
| | | * </ul> |
| | | * |
| | | * @param <T> |
| | | * type of the record being returned |
| | | * \@NotThreadSafe |
| | |
| | | |
| | | /** |
| | | * Represents a cursor key matching strategy, which allow to choose if only |
| | | * the exact key must be found or if any key equals or higher should match. |
| | | * the exact key must be found or if any key equal or lower/higher should match. |
| | | */ |
| | | public enum KeyMatchingStrategy { |
| | | /** matches if the key or a lower key is found. */ |
| | | LESS_THAN_OR_EQUAL_TO_KEY, |
| | | /** matches only if the exact key is found. */ |
| | | EQUAL_TO_KEY, |
| | | /** matches if the key or a greater key is found. */ |