|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.persist.BasicCursor<V>
class BasicCursor<V>
Implements EntityCursor and uses a ValueAdapter so that it can enumerate either keys or entities.
Field Summary | |
---|---|
(package private) ValueAdapter<V> |
adapter
|
(package private) RangeCursor |
cursor
|
(package private) DatabaseEntry |
data
|
(package private) DatabaseEntry |
key
|
(package private) DatabaseEntry |
pkey
|
Constructor Summary | |
---|---|
BasicCursor(RangeCursor cursor,
ValueAdapter<V> adapter)
|
Method Summary | |
---|---|
(package private) void |
checkInitialized()
|
void |
close()
Closes the cursor. |
int |
count()
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, Returns one or zero if the underlying index has unique keys. |
V |
current()
Returns the value at the cursor position, or null if the value at the cursor position has been deleted. |
V |
current(LockMode lockMode)
Returns the value at the cursor position, or null if the value at the cursor position has been deleted. |
boolean |
delete()
Deletes the entity at the cursor position. |
EntityCursor<V> |
dup()
Duplicates the cursor at the cursor position. |
V |
first()
Moves the cursor to the first value and returns it, or returns null if the cursor range is empty. |
V |
first(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 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 following the current position or at the first value if the cursor is uninitialized. |
V |
last()
Moves the cursor to the last value and returns it, or returns null if the cursor range is empty. |
V |
last(LockMode lockMode)
Moves the cursor to the last value and returns it, or returns null if the cursor range is empty. |
V |
next()
Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range. |
V |
next(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. |
V |
nextDup()
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. |
V |
nextDup(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. |
V |
nextNoDup()
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. |
V |
nextNoDup(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. |
V |
prev()
Moves the cursor to the previous value and returns it, or returns null if there are no preceding values in the cursor range. |
V |
prev(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. |
V |
prevDup()
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. |
V |
prevDup(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. |
V |
prevNoDup()
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. |
V |
prevNoDup(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. |
(package private) V |
returnValue(OperationStatus status)
|
boolean |
update(V entity)
Replaces the entity at the cursor position with the given entity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
RangeCursor cursor
ValueAdapter<V> adapter
DatabaseEntry key
DatabaseEntry pkey
DatabaseEntry data
Constructor Detail |
---|
BasicCursor(RangeCursor cursor, ValueAdapter<V> adapter)
Method Detail |
---|
public V first() throws DatabaseException
EntityCursor
LockMode.DEFAULT
is used implicitly.
first
in interface EntityCursor<V>
DatabaseException
public V first(LockMode lockMode) throws DatabaseException
EntityCursor
first
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V last() throws DatabaseException
EntityCursor
LockMode.DEFAULT
is used implicitly.
last
in interface EntityCursor<V>
DatabaseException
public V last(LockMode lockMode) throws DatabaseException
EntityCursor
last
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V next() throws DatabaseException
EntityCursor
EntityCursor.first()
.
LockMode.DEFAULT
is used implicitly.
next
in interface EntityCursor<V>
next
in interface ForwardCursor<V>
DatabaseException
public V next(LockMode lockMode) throws DatabaseException
EntityCursor
EntityCursor.first()
.
next
in interface EntityCursor<V>
next
in interface ForwardCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V nextDup() throws DatabaseException
EntityCursor
LockMode.DEFAULT
is used implicitly.
nextDup
in interface EntityCursor<V>
DatabaseException
public V nextDup(LockMode lockMode) throws DatabaseException
EntityCursor
nextDup
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V nextNoDup() throws DatabaseException
EntityCursor
EntityCursor.first()
.
LockMode.DEFAULT
is used implicitly.
nextNoDup
in interface EntityCursor<V>
DatabaseException
public V nextNoDup(LockMode lockMode) throws DatabaseException
EntityCursor
EntityCursor.first()
.
nextNoDup
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V prev() throws DatabaseException
EntityCursor
EntityCursor.last()
.
LockMode.DEFAULT
is used implicitly.
prev
in interface EntityCursor<V>
DatabaseException
public V prev(LockMode lockMode) throws DatabaseException
EntityCursor
EntityCursor.last()
.
prev
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V prevDup() throws DatabaseException
EntityCursor
LockMode.DEFAULT
is used implicitly.
prevDup
in interface EntityCursor<V>
DatabaseException
public V prevDup(LockMode lockMode) throws DatabaseException
EntityCursor
prevDup
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V prevNoDup() throws DatabaseException
EntityCursor
EntityCursor.last()
.
LockMode.DEFAULT
is used implicitly.
prevNoDup
in interface EntityCursor<V>
DatabaseException
public V prevNoDup(LockMode lockMode) throws DatabaseException
EntityCursor
EntityCursor.last()
.
prevNoDup
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public V current() throws DatabaseException
EntityCursor
LockMode.DEFAULT
is used implicitly.
current
in interface EntityCursor<V>
DatabaseException
public V current(LockMode lockMode) throws DatabaseException
EntityCursor
current
in interface EntityCursor<V>
lockMode
- the lock mode to use for this operation, or null to
use LockMode.DEFAULT
.
DatabaseException
public int count() throws DatabaseException
EntityCursor
LockMode.DEFAULT
is used implicitly.
count
in interface EntityCursor<V>
DatabaseException
public Iterator<V> iterator()
EntityCursor
LockMode.DEFAULT
is used implicitly.
iterator
in interface EntityCursor<V>
iterator
in interface ForwardCursor<V>
iterator
in interface Iterable<V>
public Iterator<V> iterator(LockMode lockMode)
EntityCursor
iterator
in interface EntityCursor<V>
iterator
in interface ForwardCursor<V>
lockMode
- the lock mode to use for all operations performed
using the iterator, or null to use LockMode.DEFAULT
.
public boolean update(V entity) throws DatabaseException
EntityCursor
update
in interface EntityCursor<V>
entity
- the entity to replace the entity at the current position.
DatabaseException
public boolean delete() throws DatabaseException
EntityCursor
delete
in interface EntityCursor<V>
DatabaseException
public EntityCursor<V> dup() throws DatabaseException
EntityCursor
Transaction
and CursorConfig
.
dup
in interface EntityCursor<V>
DatabaseException
public void close() throws DatabaseException
EntityCursor
close
in interface EntityCursor<V>
close
in interface ForwardCursor<V>
DatabaseException
void checkInitialized() throws IllegalStateException
IllegalStateException
V returnValue(OperationStatus status)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |