de.innovationgate.wga.server.api
public abstract class CollectionResult extends Object implements Iterable<Context>
Modifier and Type | Class and Description |
---|---|
static interface |
CollectionResult.Filter
A filter to be applied to a CollectionResult via method
filter(Filter) |
Modifier and Type | Method and Description |
---|---|
int |
determineCurrentIndex(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 |
CollectionResult |
getOriginalResult()
Returns the original
QueryResult or NavigatorResult t 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
|
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.
|
abstract de.innovationgate.utils.SkippingIterator<Context> |
iterator() |
CollectionResult |
skip(int size)
Creates a
CollectionResult which skips the first documents in the current collection result |
String |
toString() |
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.WGException
public 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.WGException
public CollectionResult getOriginalResult() throws de.innovationgate.webgate.api.WGException
QueryResult
or NavigatorResult
t of this collection resultde.innovationgate.webgate.api.WGException
public 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.WGException
public int determineCurrentIndex(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.WGException
public int getSize() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public abstract de.innovationgate.utils.SkippingIterator<Context> iterator()
public CollectionResult exclude(Context cx) throws de.innovationgate.webgate.api.WGException
CollectionResult
omitting the given documentcx
- Context of the document to omitde.innovationgate.webgate.api.WGException