public abstract class CollectionResult extends java.lang.Object implements java.lang.Iterable<Context>
| Modifier and Type | Class and Description |
|---|---|
static interface |
CollectionResult.Filter
A filter to be applied to a CollectionResult via method
filter(Filter) |
static interface |
CollectionResult.Wrapper<T>
A wrapper that transforms Contextes in other result objects
|
| Modifier and Type | Method and Description |
|---|---|
int |
determineCurrentIndex(java.util.Iterator<?> it)
Returns the index of the last returned result document from the given iterator that this document had on the original collection result.
|
CollectionResult |
exclude(Context cx)
Creates a new
CollectionResult omitting the given document |
CollectionResult |
filter(CollectionResult.Filter filter)
Creates a new
CollectionResult containing only documents that pass the given filter |
Context |
getFirstResult()
Returns the first result of the query
This is an effective way of returning the very first document that is returned by the query if only this is important.
|
de.innovationgate.webgate.api.WGContent |
getFirstResultContent()
Returns the first result content of the query as WGAPI content object
This is an effective way of returning the very first content document that is returned by the query if only this is important.
|
CollectionResult |
getOriginalResult()
Returns the original
QueryResult or NavigatorResultt of this collection result |
CollectionPage |
getPage(int size)
Returns a page of contents from the navigator result on its current offset (being 1 if no offset-modifying actions like
skip(int) have been used) |
CollectionPage |
getPage(int start,
int size)
Returns a page of contents from the navigator result
|
java.lang.Object |
getSingleValue(java.lang.String itemName)
Returns a single value of the first result content of the query.
|
int |
getSize()
Returns the number of result documents in the collection
This is the number of results in the original collection, containing all documents that may be unreadable, not visible or skipped.
|
boolean |
isEmpty() |
abstract de.innovationgate.utils.SkippingIterator<Context> |
iterator() |
CollectionResult |
skip(int size)
Creates a
CollectionResult which skips the first documents in the current collection result |
java.lang.String |
toString() |
<T> java.lang.Iterable<T> |
wrap(CollectionResult.Wrapper<T> wrapper)
Returns an iterable whose iterators wrap/transform the returned documents into some custom object
|
public CollectionResult filter(CollectionResult.Filter filter) throws de.innovationgate.webgate.api.WGException
CollectionResult containing only documents that pass the given filterfilter - A collection result filterde.innovationgate.webgate.api.WGExceptionpublic CollectionResult skip(int size) throws de.innovationgate.webgate.api.WGException
CollectionResult which skips the first documents in the current collection resultsize - Number of documents to skipde.innovationgate.webgate.api.WGExceptionpublic CollectionResult getOriginalResult() throws de.innovationgate.webgate.api.WGException
QueryResult or NavigatorResultt of this collection resultde.innovationgate.webgate.api.WGExceptionpublic CollectionPage getPage(int start, int size) throws de.innovationgate.webgate.api.WGException
start - The starting number from which to retrieve, 1 being the first content. Note that this is the start position from the offset that may already been chosen by previous actions, like skip(int)size - The number of contents to retrieveContext objectsde.innovationgate.webgate.api.WGExceptionpublic int determineCurrentIndex(java.util.Iterator<?> it)
it - The iterator. Must be an iterator returned from a CollectionResult objectpublic CollectionPage getPage(int size) throws de.innovationgate.webgate.api.WGException
skip(int) have been used)size - The number of contents to retrieveContext objectsde.innovationgate.webgate.api.WGExceptionpublic int getSize()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic abstract de.innovationgate.utils.SkippingIterator<Context> iterator()
iterator in interface java.lang.Iterable<Context>public java.lang.String toString()
toString in class java.lang.Objectpublic CollectionResult exclude(Context cx) throws de.innovationgate.webgate.api.WGException
CollectionResult omitting the given documentcx - Context of the document to omitde.innovationgate.webgate.api.WGExceptionpublic Context getFirstResult() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic java.lang.Object getSingleValue(java.lang.String itemName)
throws de.innovationgate.webgate.api.WGException
itemName - The name of the item on the first result content, containing the desired valuede.innovationgate.webgate.api.WGExceptionpublic de.innovationgate.webgate.api.WGContent getFirstResultContent()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic boolean isEmpty()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic <T> java.lang.Iterable<T> wrap(CollectionResult.Wrapper<T> wrapper) throws de.innovationgate.webgate.api.WGException
wrapper - A wrapping implementationde.innovationgate.webgate.api.WGException