net.sourceforge.openutils.mgnlcriteria.jcr.query
Interface AdvancedResult

All Known Implementing Classes:
AdvancedResult.EmptyResult, AdvancedResultImpl

public interface AdvancedResult

The result of a jcr query. You can access to the actual result items using getItems(). This bean will also give you information about the total number of available items, the current page number, the total number of pages.

Version:
$Id: AdvancedResult.java 2923 2010-08-29 08:58:29Z fgiust $
Author:
fgiust

Nested Class Summary
static class AdvancedResult.EmptyResult
           
static class AdvancedResult.EmptyResultIterator
           
 
Field Summary
static AdvancedResult EMPTY_RESULT
          An empty result.
 
Method Summary
 AdvancedResultItem getFirstResult()
          Returns the fist result if available, null otherwise.
 ResultIterator<AdvancedResultItem> getItems()
          Gets an iterator over the results
<K> ResultIterator<K>
getItems(Class<K> theclass)
          Gets an iterator over the results, transforming objects using content2bean while iterating
 int getItemsPerPage()
          Gets the maximum number of results per page
 int getNumberOfPages()
          Gets the total number of pages
 int getPage()
          Gets the page number (1, 2, 3...)
 String getSpellCheckerSuggestion()
          Gets the suggestion from the spell checker.
 int getTotalSize()
          Gets the total number of results that would be retrieved without pagination.
 

Field Detail

EMPTY_RESULT

static final AdvancedResult EMPTY_RESULT
An empty result.

Method Detail

getItemsPerPage

int getItemsPerPage()
Gets the maximum number of results per page

Returns:
the maximum number of results per page

getPage

int getPage()
Gets the page number (1, 2, 3...)

Returns:
the page number (1, 2, 3...)

getTotalSize

int getTotalSize()
Gets the total number of results that would be retrieved without pagination. Note that jackrabbit may return -1 if the query doesn't have a sort condition, in order to optimize execution. Always add an order by clause (e.g. "order by @jcr:score") if you need to get the total size.

Returns:
the total number of results that would be retrieved without pagination.

getNumberOfPages

int getNumberOfPages()
Gets the total number of pages

Returns:
total number of pages

getSpellCheckerSuggestion

String getSpellCheckerSuggestion()
Gets the suggestion from the spell checker. Note that spell checker must be configured in jackrabbit for this to work. See http://wiki.apache.org/jackrabbit/Search for details.

Returns:
the suggestion from the spell checker

getItems

ResultIterator<AdvancedResultItem> getItems()
Gets an iterator over the results

Returns:
an iterator over the results

getItems

<K> ResultIterator<K> getItems(Class<K> theclass)
Gets an iterator over the results, transforming objects using content2bean while iterating

Type Parameters:
K - destination class.
Parameters:
theclass - destination class.
Returns:
an iterator over the results

getFirstResult

AdvancedResultItem getFirstResult()
Returns the fist result if available, null otherwise.

Returns:
the fist result if available, null otherwise.


Copyright © 2009-2010 Openmind. All Rights Reserved.