public interface SearchResults
Users should note that a SearchResults instance may hold on to
system resources such as data store connections or cursors. It
is recommended that each instance be explicitly closed, preferably
within a try/finally block to guarantee that resources are returned
to the system. For example:
SearchResults results = null;
try {
results = ...;
...
}
finally {
if (results != null)
results.close();
}
SearchResultsIterator,
SearchResultsStatus| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the current contents, cancels the search, and closes any live
connection to the data store, freeing up any resources allocated to
that connection.
|
void |
close()
Cancels the search, and closes any live connection to the data store,
freeing up any resources allocated to that connection.
|
boolean |
equals(java.lang.Object o)
Overrides the Object.equals behavior, returning true if the objects
both hold the same results.
|
SearchResultsStatus |
getStatus()
Returns the final status of the search.
|
boolean |
isClosed()
Is the result set closed?
|
boolean |
isEmpty()
Returns whether there are any results.
|
boolean |
isSorted()
Is the result set sorted?
|
SearchResultsIterator |
iterator()
Returns an iterator over the elements in this collection.
|
int |
size()
Returns the number of results returned.
|
int |
size(SearchResultsStatus status)
Returns the number of results returned.
|
java.util.Collection |
toCollection()
Returns the results returned as a Collection.
|
java.util.Collection |
toCollection(SearchResultsStatus status)
Returns the results returned as a Collection.
|
void clear()
void close()
boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - Object to compare (must be a SearchResults).boolean isEmpty()
throws PartialResultsException
PartialResultsException - Thrown if an error was detected
trying to determine if a result was obtained from the data
store.boolean isSorted()
throws PartialResultsException
PartialResultsExceptionboolean isClosed()
throws PartialResultsException
PartialResultsExceptionSearchResultsIterator iterator()
int size() throws PartialResultsException
PartialResultsException - Thrown if an error was detected
trying to retrieve all results from the data store, most
likely to a size limit threshold violation.int size(SearchResultsStatus status)
status - SearchResultsStatus to fill with the final status of the search.
If an error was detected, the details will be provided
here. This parameter is optional, if not provided (null),
no status will be returned.java.util.Collection toCollection()
throws PartialResultsException
PartialResultsException - Thrown if an error was detected
trying to retrieve all results from the data store, most
likely to a size limit threshold violation.java.util.Collection toCollection(SearchResultsStatus status)
status - SearchResultsStatus to fill with the final status of the search.
If an error was detected, the details will be provided
here. This parameter is optional, if not provided (null),
no status will be returned.SearchResultsStatus getStatus()