Interface RequestResult

All Superinterfaces:
AutoCloseable, Iterable<Adaptation>

public interface RequestResult extends Iterable<Adaptation>, AutoCloseable
Represents the result of a Request.

Traversing and closing the result

A RequestResult instance must always be closed after its use.

Here is a code sample benefiting from the automatic closing provided by AutoCloseable and its associated try-with-resources notation:

 
 try (RequestResult result = ...)
 {
        for (Adaptation record : result)
        {
                ...
        }
 }
 
 

Note that a RequestResult can be traversed only once, either by iterator (like the above example) or by nextAdaptation(). Trying to create multiple iterators will result in an exception. Similarly, trying to call nextAdaptation() after an iterator has been created (or vice-versa) will also result in an exception.

Concurrency

A RequestResult instance is not thread-safe and it must be used only by the thread that created it.

If the table is concurrently updated, the rules specified by Query snapshot isolation apply.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method must always be invoked once this result is no longer used, so as to ensure that underlying resources are released.
    boolean
    Returns true if the specified record belongs to the result of this request (even if the record is obsolete).
    Returns the request that created this result.
    int
    Returns the total number of records held by this result.
    Returns the underlying table.
    boolean
    Returns true if the result is empty (that is, size is 0).
    boolean
    Returns true if this result may have changed since last computation.
    boolean
    isSizeEqual(int aSize)
    Verifies the number of records contained in this result.
    boolean
    isSizeGreaterOrEqual(int minimalSize)
    Verifies the number of records contained in this result.
    Moves the cursor to the next record in the result and returns it.
    void
    Deprecated.
    This method does not do anything: in accordance to Query snapshot isolation, the result is frozen when Request.execute() is called.
    boolean
    Deprecated.
    This method does not do anything: in accordance to Query snapshot isolation, the result is frozen when Request.execute() is called.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator