From 780b92ada9afcf1d58085a83a0b9e6bc982203d1 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 17 Feb 2015 17:25:57 +0000 Subject: Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz. --- docs/java/com/sleepycat/persist/EntityCursor.html | 1820 ++++++++++----------- 1 file changed, 829 insertions(+), 991 deletions(-) (limited to 'docs/java/com/sleepycat/persist/EntityCursor.html') diff --git a/docs/java/com/sleepycat/persist/EntityCursor.html b/docs/java/com/sleepycat/persist/EntityCursor.html index 33433833..f5dd1b3c 100644 --- a/docs/java/com/sleepycat/persist/EntityCursor.html +++ b/docs/java/com/sleepycat/persist/EntityCursor.html @@ -1,127 +1,122 @@ - - - - - -EntityCursor (Oracle - Berkeley DB Java API) - - - - - - - - - - - - -
- - +//--> + + - - - - - - - - - - - - - - - - -
-Berkeley DB
version 5.3.21
-
- + + +
+ + +
+ + + - -
-

- -com.sleepycat.persist -
-Interface EntityCursor<V>

-
-
All Superinterfaces:
ForwardCursor<V>, Iterable<V>
-
-
-
-
public interface EntityCursor<V>
extends ForwardCursor<V>
- - -

-Traverses entity values or key values and allows deleting or updating the +

+
com.sleepycat.persist
+

Interface EntityCursor<V>

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    ForwardCursor<V>, java.lang.Iterable<V>
    +
    +
    +
    +
    public interface EntityCursor<V>
    +extends ForwardCursor<V>
    +
    Traverses entity values or key values and allows deleting or updating the entity at the current cursor position. The value type (V) is either an entity class or a key class, depending on how the cursor was opened.

    EntityCursor objects are not thread-safe. Cursors should be opened, used and closed by a single thread.

    -

    Cursors are opened using the EntityIndex.keys() and EntityIndex.entities() family of methods. These methods are available for - objects of any class that implements EntityIndex: PrimaryIndex, SecondaryIndex, and the indices returned by SecondaryIndex.keysIndex and SecondaryIndex.subIndex(SK). A ForwardCursor, which implements a subset of cursor operations, is also - available via the EntityJoin.keys() and EntityJoin.entities() +

    Cursors are opened using the EntityIndex.keys() and EntityIndex.entities() family of methods. These methods are available for + objects of any class that implements EntityIndex: PrimaryIndex, SecondaryIndex, and the indices returned by SecondaryIndex.keysIndex and SecondaryIndex.subIndex(SK). A ForwardCursor, which implements a subset of cursor operations, is also + available via the EntityJoin.keys() and EntityJoin.entities() methods.

    Values are always returned by a cursor in key order, where the key is - defined by the underlying EntityIndex. For example, a cursor on a - SecondaryIndex returns values ordered by secondary key, while an - index on a PrimaryIndex or a SecondaryIndex.subIndex(SK) returns + defined by the underlying EntityIndex. For example, a cursor on a + SecondaryIndex returns values ordered by secondary key, while an + index on a PrimaryIndex or a SecondaryIndex.subIndex(SK) returns values ordered by primary key.

    WARNING: Cursors must always be closed to prevent resource leaks which could lead to the index becoming unusable or cause an OutOfMemoryError. To ensure that a cursor is closed in the - face of exceptions, call close() in a finally block. For example, + face of exceptions, call close() in a finally block. For example, the following code traverses all Employee entities and closes the cursor whether or not an exception occurs:

    @@ -160,11 +155,11 @@ Traverses entity values or key values and allows deleting or updating the

    When it is opened, a cursor is not initially positioned on any value; in other words, it is uninitialized. Most methods in this interface initialize - the cursor position but certain methods, for example, current() and - delete(), throw IllegalStateException when called for an + the cursor position but certain methods, for example, current() and + delete(), throw IllegalStateException when called for an uninitialized cursor.

    -

    Note that the next() and prev() methods return the first or +

    Note that the next() and prev() methods return the first or last value respectively for an uninitialized cursor. This allows the loop in the example above to be rewritten as follows:

    @@ -181,7 +176,7 @@ Traverses entity values or key values and allows deleting or updating the

    Cursors and Iterators

    -

    The iterator() method can be used to return a standard Java Iterator that returns the same values that the cursor returns. For +

    The iterator() method can be used to return a standard Java Iterator that returns the same values that the cursor returns. For example:

    @@ -196,7 +191,7 @@ Traverses entity values or key values and allows deleting or updating the
          cursor.close();
      }
    -

    The Iterable interface is also extended by EntityCursor +

    The Iterable interface is also extended by EntityCursor to allow using the cursor as the target of a Java "foreach" statement:

    @@ -211,24 +206,24 @@ Traverses entity values or key values and allows deleting or updating the
     
      

    The iterator uses the cursor directly, so any changes to the cursor position impact the iterator and vice versa. The iterator advances the - cursor by calling next() when Iterator.hasNext() or Iterator.next() is called. Because of this interaction, to keep things + cursor by calling next() when Iterator.hasNext() or Iterator.next() is called. Because of this interaction, to keep things simple it is best not to mix the use of an EntityCursor Iterator with the use of the EntityCursor traversal methods - such as next(), for a single EntityCursor object.

    + such as next(), for a single EntityCursor object.

    Key Ranges

    A key range may be specified when opening the cursor, to restrict the key range of the cursor to a subset of the complete range of keys in the index. A fromKey and/or toKey parameter may be specified - when calling EntityIndex.keys(Object,boolean,Object,boolean) or - EntityIndex.entities(Object,boolean,Object,boolean). The key + when calling EntityIndex.keys(Object,boolean,Object,boolean) or + EntityIndex.entities(Object,boolean,Object,boolean). The key arguments may be specified as inclusive or exclusive values.

    Whenever a cursor with a key range is moved, the key range bounds will be checked, and the cursor will never be positioned outside the range. The - first() cursor value is the first existing value in the range, and - the last() cursor value is the last existing value in the range. For + first() cursor value is the first existing value in the range, and + the last() cursor value is the last existing value in the range. For example, the following code traverses Employee entities with keys from 100 (inclusive) to 200 (exclusive):

    @@ -244,26 +239,26 @@ Traverses entity values or key values and allows deleting or updating the

    Duplicate Keys

    -

    When using a cursor for a SecondaryIndex, the keys in the index - may be non-unique (duplicates) if SecondaryKey.relate() is MANY_TO_ONE or MANY_TO_MANY. For example, a MANY_TO_ONE Employee.department secondary key is non-unique because there are multiple - Employee entities with the same department key value. The nextDup(), - prevDup(), nextNoDup() and prevNoDup() methods may be +

    When using a cursor for a SecondaryIndex, the keys in the index + may be non-unique (duplicates) if SecondaryKey.relate() is MANY_TO_ONE or MANY_TO_MANY. For example, a MANY_TO_ONE Employee.department secondary key is non-unique because there are multiple + Employee entities with the same department key value. The nextDup(), + prevDup(), nextNoDup() and prevNoDup() methods may be used to control how non-unique keys are returned by the cursor.

    -

    nextDup() and prevDup() return the next or previous value +

    nextDup() and prevDup() return the next or previous value only if it has the same key as the current value, and null is returned when a different key is encountered. For example, these methods can be used to return all employees in a given department.

    -

    nextNoDup() and prevNoDup() return the next or previous +

    nextNoDup() and prevNoDup() return the next or previous value with a unique key, skipping over values that have the same key. For example, these methods can be used to return the first employee in each department.

    For example, the following code will find the first employee in each - department with nextNoDup() until it finds a department name that + department with nextNoDup() until it finds a department name that matches a particular regular expression. For each matching department it - will find all employees in that department using nextDup().

    + will find all employees in that department using nextDup().

      SecondaryIndex<String, Long, Employee> secondaryIndex =
    @@ -288,7 +283,7 @@ Traverses entity values or key values and allows deleting or updating the
     
      

    Updating and Deleting Entities with a Cursor

    -

    The update(V) and delete() methods operate on the entity at +

    The update(V) and delete() methods operate on the entity at the current cursor position. Cursors on any type of index may be used to delete entities. For example, the following code deletes all employees in departments which have names that match a particular regular expression:

    @@ -318,12 +313,12 @@ Traverses entity values or key values and allows deleting or updating the deleting the entity at the current position. This is an important property of cursors, since without it you would not be able to easily delete while processing multiple values with a cursor. A cursor positioned on a deleted - entity is in a special state. In this state, current() will return - null, delete() will return false, and update(V) will return + entity is in a special state. In this state, current() will return + null, delete() will return false, and update(V) will return false.

    -

    The update(V) method is supported only if the value type is an - entity class (not a key class) and the underlying index is a PrimaryIndex; in other words, for a cursor returned by one of the BasicIndex.entities() methods. For example, the following code changes all +

    The update(V) method is supported only if the value type is an + entity class (not a key class) and the underlying index is a PrimaryIndex; in other words, for a cursor returned by one of the BasicIndex.entities() methods. For example, the following code changes all employee names to uppercase:

    @@ -337,919 +332,762 @@ Traverses entity values or key values and allows deleting or updating the
          }
      } finally {
          cursor.close();
    - }
    -

    - -

    -


    - -

    - + }

    +
  • +
+
+
+
    +
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
    -Method Summary
    - voidclose() - -
    -          Closes the cursor.
    - intcount() - -
    -          Returns the number of values (duplicates) for the key at the cursor - position, or returns zero if all values for the key have been deleted.
    - Vcurrent() - -
    -          Returns the value at the cursor position, or null if the value at the - cursor position has been deleted.
    - Vcurrent(LockMode lockMode) - -
    -          Returns the value at the cursor position, or null if the value at the - cursor position has been deleted.
    - booleandelete() - -
    -          Deletes the entity at the cursor position.
    - EntityCursor<V>dup() - -
    -          Duplicates the cursor at the cursor position.
    - Vfirst() - -
    -          Moves the cursor to the first value and returns it, or returns null if - the cursor range is empty.
    - Vfirst(LockMode lockMode) - -
    -          Moves the cursor to the first value and returns it, or returns null if - the cursor range is empty.
    - Iterator<V>iterator() - -
    -          Returns an iterator over the key range, starting with the value +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - -
      Methods 
      Modifier and TypeMethod and Description
      voidclose() +
      Closes the cursor.
      +
      intcount() +
      Returns the number of values (duplicates) for the key at the cursor + position, or returns zero if all values for the key have been deleted.
      +
      Vcurrent() +
      Returns the value at the cursor position, or null if the value at the + cursor position has been deleted.
      +
      Vcurrent(LockMode lockMode) +
      Returns the value at the cursor position, or null if the value at the + cursor position has been deleted.
      +
      booleandelete() +
      Deletes the entity at the cursor position.
      +
      EntityCursor<V>dup() +
      Duplicates the cursor at the cursor position.
      +
      Vfirst() +
      Moves the cursor to the first value and returns it, or returns null if + the cursor range is empty.
      +
      Vfirst(LockMode lockMode) +
      Moves the cursor to the first value and returns it, or returns null if + the cursor range is empty.
      +
      java.util.Iterator<V>iterator() +
      Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is - uninitialized.
      - Iterator<V>iterator(LockMode lockMode) - -
      -          Returns an iterator over the key range, starting with the value + uninitialized. +
      java.util.Iterator<V>iterator(LockMode lockMode) +
      Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is - uninitialized.
      - Vlast() - -
      -          Moves the cursor to the last value and returns it, or returns null if - the cursor range is empty.
      - Vlast(LockMode lockMode) - -
      -          Moves the cursor to the last value and returns it, or returns null if - the cursor range is empty.
      - Vnext() - -
      -          Moves the cursor to the next value and returns it, or returns null - if there are no more values in the cursor range.
      - Vnext(LockMode lockMode) - -
      -          Moves the cursor to the next value and returns it, or returns null - if there are no more values in the cursor range.
      - VnextDup() - -
      -          Moves the cursor to the next value with the same key (duplicate) and + uninitialized. +
      Vlast() +
      Moves the cursor to the last value and returns it, or returns null if + the cursor range is empty.
      +
      Vlast(LockMode lockMode) +
      Moves the cursor to the last value and returns it, or returns null if + the cursor range is empty.
      +
      Vnext() +
      Moves the cursor to the next value and returns it, or returns null + if there are no more values in the cursor range.
      +
      Vnext(LockMode lockMode) +
      Moves the cursor to the next value and returns it, or returns null + if there are no more values in the cursor range.
      +
      VnextDup() +
      Moves the cursor to the next value with the same key (duplicate) and returns it, or returns null if no more values are present for the key at - the current position.
      - VnextDup(LockMode lockMode) - -
      -          Moves the cursor to the next value with the same key (duplicate) and + the current position. +
      VnextDup(LockMode lockMode) +
      Moves the cursor to the next value with the same key (duplicate) and returns it, or returns null if no more values are present for the key at - the current position.
      - VnextNoDup() - -
      -          Moves the cursor to the next value with a different key and returns it, - or returns null if there are no more unique keys in the cursor range.
      - VnextNoDup(LockMode lockMode) - -
      -          Moves the cursor to the next value with a different key and returns it, - or returns null if there are no more unique keys in the cursor range.
      - Vprev() - -
      -          Moves the cursor to the previous value and returns it, or returns null - if there are no preceding values in the cursor range.
      - Vprev(LockMode lockMode) - -
      -          Moves the cursor to the previous value and returns it, or returns null - if there are no preceding values in the cursor range.
      - VprevDup() - -
      -          Moves the cursor to the previous value with the same key (duplicate) and + the current position. +
      VnextNoDup() +
      Moves the cursor to the next value with a different key and returns it, + or returns null if there are no more unique keys in the cursor range.
      +
      VnextNoDup(LockMode lockMode) +
      Moves the cursor to the next value with a different key and returns it, + or returns null if there are no more unique keys in the cursor range.
      +
      Vprev() +
      Moves the cursor to the previous value and returns it, or returns null + if there are no preceding values in the cursor range.
      +
      Vprev(LockMode lockMode) +
      Moves the cursor to the previous value and returns it, or returns null + if there are no preceding values in the cursor range.
      +
      VprevDup() +
      Moves the cursor to the previous value with the same key (duplicate) and returns it, or returns null if no preceding values are present for the - key at the current position.
      - VprevDup(LockMode lockMode) - -
      -          Moves the cursor to the previous value with the same key (duplicate) and + key at the current position. +
      VprevDup(LockMode lockMode) +
      Moves the cursor to the previous value with the same key (duplicate) and returns it, or returns null if no preceding values are present for the - key at the current position.
      - VprevNoDup() - -
      -          Moves the cursor to the preceding value with a different key and returns + key at the current position. +
      VprevNoDup() +
      Moves the cursor to the preceding value with a different key and returns it, or returns null if there are no preceding unique keys in the cursor - range.
      - VprevNoDup(LockMode lockMode) - -
      -          Moves the cursor to the preceding value with a different key and returns + range. +
      VprevNoDup(LockMode lockMode) +
      Moves the cursor to the preceding value with a different key and returns it, or returns null if there are no preceding unique keys in the cursor - range.
      - booleanupdate(V entity) - -
      -          Replaces the entity at the cursor position with the given entity.
      -  -

      - + range. +

    booleanupdate(V entity) +
    Replaces the entity at the cursor position with the given entity.
    +
    +
  • +
+ + +
+
+
    +
  • - - - - - - -
    -Method Detail
    - -

    -first

    -
    -V first()
    -        throws DatabaseException
    -
    -
    Moves the cursor to the first value and returns it, or returns null if - the cursor range is empty. - -

    LockMode.DEFAULT is used implicitly.

    -

    -

    -
    -
    -
    - -
    Returns:
    the first value, or null if the cursor range is empty. -
    Throws: -
    DatabaseException - the base class for all BDB exceptions.
    -
    -
    -
    - -

    -first

    -
    -V first(LockMode lockMode)
    -        throws DatabaseException
    -
    -
    Moves the cursor to the first value and returns it, or returns null if +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        first

        +
        V first()
        +        throws DatabaseException
        +
        Moves the cursor to the first value and returns it, or returns null if the cursor range is empty. -

        -

        -
        -
        -
        -
        Parameters:
        lockMode - the lock mode to use for this operation, or null to - use LockMode.DEFAULT. -
        Returns:
        the first value, or null if the cursor range is empty. -
        Throws: -
        DatabaseException - the base class for all BDB exceptions.
        -
        -
    -
    -

    -last

    -
    -V last()
    -       throws DatabaseException
    -
    -
    Moves the cursor to the last value and returns it, or returns null if +

    LockMode.DEFAULT is used implicitly.

+
Returns:
the first value, or null if the cursor range is empty.
+
Throws:
+
DatabaseException - the base class for all BDB exceptions.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ -
- - - - - - - - - - - - - - - - - - -
-Berkeley DB
version 5.3.21
-
- + + +
+ + +
+ + + - -
-Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved. - - +

Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved.

+ + -- cgit v1.2.1