Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
java: fix minor issues in JavaDocs comments in ReadIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszstolarczuk committed Jul 1, 2021
1 parent d796ec2 commit 95e4d3a
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions pmemkv-binding/src/main/java/io/pmem/pmemkv/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ public class Database<K, V> {
* iterate over records in db. It allows reading record's key and value, but not
* modify them. Any changes to iterators will not be reflected in the database.
* This object can only be created using Database method:
* {@link io.pmem.pmemkv.Database#readIterator() readIterator()} . Holding
* simultaneously, in the same thread, more than one iterator is undefined
* behavior.
* {@link io.pmem.pmemkv.Database#readIterator() readIterator()} .
* <p>
* Holding simultaneously, in the same thread, more than one iterator is
* undefined behavior.
* <p>
* IMPORTANT: This is an EXPERIMENTAL feature and should not be used in
* production code. For now, we don't guarantee stability of this API.
Expand All @@ -65,7 +66,7 @@ public class ReadIterator implements AutoCloseable {

/**
* Changes iterator position to a record with the given key.
*
* <p>
* If the record is present and no errors occurred, returns true. If the record
* does not exist, false is returned and the iterator position is undefined. It
* internally aborts all uncommitted changes made to an element previously
Expand All @@ -85,7 +86,7 @@ public boolean seek(K key) throws DatabaseException {

/**
* Changes iterator position to a record with a key lower than the given key.
*
* <p>
* If the record is present and no errors occurred, returns true. If the record
* does not exist, false is returned and the iterator position is undefined. It
* internally aborts all uncommitted changes made to an element previously
Expand All @@ -106,7 +107,7 @@ public boolean seekLower(K key) throws DatabaseException {
/**
* Changes iterator position to a record with a key equal to or lower than the
* given key.
*
* <p>
* If the record is present and no errors occurred, returns true. If the record
* does not exist, false is returned and the iterator position is undefined. It
* internally aborts all uncommitted changes made to an element previously
Expand All @@ -126,7 +127,7 @@ public boolean seekLowerEq(K key) throws DatabaseException {

/**
* Changes iterator position to a record with a key higher than the given key.
*
* <p>
* If the record is present and no errors occurred, returns true. If the record
* does not exist, false is returned and the iterator position is undefined. It
* internally aborts all uncommitted changes made to an element previously
Expand All @@ -147,7 +148,7 @@ public boolean seekHigher(K key) throws DatabaseException {
/**
* Changes iterator position to a record with a key equal to or higher than the
* given key.
*
* <p>
* If the record is present and no errors occurred, returns true. If the record
* does not exist, false is returned and the iterator position is undefined. It
* internally aborts all uncommitted changes made to an element previously
Expand All @@ -167,7 +168,7 @@ public boolean seekHigherEq(K key) throws DatabaseException {

/**
* Changes iterator position to a first record.
*
* <p>
* If db isn't empty and no errors occurred, returns true. If db is empty, false
* is returned and the iterator position is undefined. It internally aborts all
* uncommitted changes made to an element previously pointed by the iterator.
Expand All @@ -183,7 +184,7 @@ public boolean seekToFirst() throws DatabaseException {

/**
* Changes iterator position to a last record.
*
* <p>
* If db isn't empty and no errors occurred, returns true. If db is empty, false
* is returned and the iterator position is undefined. It internally aborts all
* uncommitted changes made to an element previously pointed by the iterator.
Expand All @@ -198,10 +199,10 @@ public boolean seekToLast() throws DatabaseException {
}

/**
* Returns key of a record currently pointed by the iterator. It is just a copy
* of the current record - key cannot be updated in the Database using this
* method.
*
* Returns the entire key of a record currently pointed by the iterator. It is
* just a copy of the current record - key cannot be updated in the Database
* using this method.
* <p>
* If the iterator is on an undefined position, calling this method is undefined
* behaviour.
*
Expand All @@ -223,10 +224,10 @@ public K key() throws DatabaseException, OutOfMemoryError {
}

/**
* Returns value of a record currently pointed by the iterator. It is just a
* copy of the current record - data cannot be written to the Database using
* this method.
*
* Returns the entire value of a record currently pointed by the iterator. It is
* just a copy of the current record - data cannot be written to the Database
* using this method.
* <p>
* If the iterator is on an undefined position, calling this method is undefined
* behaviour.
*
Expand All @@ -249,7 +250,7 @@ public V value() throws DatabaseException, OutOfMemoryError {

/**
* Checks if there is a next record available.
*
* <p>
* If true is returned, it is guaranteed that iterator.next() will return
* status::OK, otherwise iterator is already on the last element and
* iterator.next() will return false.
Expand All @@ -263,7 +264,7 @@ public boolean isNext() {

/**
* Changes iterator position to the next record.
*
* <p>
* If the next record exists, returns true, otherwise false is returned and the
* iterator position is undefined.
*
Expand Down

0 comments on commit 95e4d3a

Please sign in to comment.