|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DASResult<E>
DASResult represents the result of invoking a data service operation or an ad-hoc query on a data service. It is an iterator, allowing forward-only access to each item in the result in turn. (The definition of "item" is consistent with the definition in the XQuery Data Model specification.)
Method Summary | ||
---|---|---|
void |
dispose()
Call when you do not intend to request any more results from this DASResult. |
|
E[] |
getItems()
Returns all items represented by this result. |
|
|
getItems(java.lang.Class<C> component)
Returns all items represented by this result. |
|
boolean |
hasNext()
Returns true if there are any remaining items in this result. |
|
boolean |
isDisposed()
Inquire whether this DASResult has been dispose()d (see dispose() ). |
|
E |
next()
Returns the next item in the result. |
|
java.lang.String |
nextAsString()
Returns the next item in the result as a simple String. |
Method Detail |
---|
boolean hasNext() throws DASException
DASException
- if there is an unexpected problem
determining if there are more items.E next() throws DASException
DASException
- if there is a problem retrieving the next
item.
java.lang.IllegalStateException
- if getItems() has previously been
called on this DASResult.java.lang.String nextAsString() throws DASException
DASException
- if there is a problem retrieving the next
item.
java.lang.IllegalStateException
- if getItems() has previously been
called on this DASResult.E[] getItems() throws DASException
After this method is called, the DASResult will be dispose()d automatically.
Note that the component type of the returned array will be
the same as the generic type E - that is, Object if this
DASResult was obtained from a dynamic DataAccessService or
PreparedExpression, or the specified type if the DASResult was
obtained from a static DataAccessService subclass. If you wish
to control the component type of the array more directly - for
instance, if you know that all returned Objects will be
DataObjects and you'd like to cast the return value to
DataObject[] - use getItems(Class)
.
DASException
- if there is a problem retrieving the
results.
java.lang.IllegalStateException
- if next() has previously been
called on this DASResult.<C> C[] getItems(java.lang.Class<C> component) throws DASException
After this method is called, the DASResult will be dispose()d automatically.
component
- The class to use as the component type of the
returned array. Must not be null. Must represent a legitimate
superclass of all objects that will be returned.
DASException
- if there is a problem retrieving the
results.
java.lang.IllegalStateException
- if next() has previously been
called on this DASResult.
java.lang.ArrayStoreException
- if component represents a class
which is not a superclass of all elements of the array.void dispose() throws DASException
isDisposed()
); this method will silently return in
that case.
DASException
- if there are unexpected problems in
attempting to free up server resources.boolean isDisposed()
dispose()
). If it has not yet been disposed, it may still be
holding open resources on the server. Note that being
dispose()d does NOT necessarily mean that no more results can
be returned from next(); in particular, a DASResult obtained
when the RequestConfig option RequestConfig.FETCH_ALL_IMMEDIATELY
is specified
will be disposed before it is returned to the client.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |