org.gcube.indexmanagement.geo
Class QueryResults

java.lang.Object
  extended by org.gcube.indexmanagement.geo.QueryResults

public class QueryResults
extends Object

A class used to wrap the results of a query in order to incrementally refine, sort and return them upon request


Constructor Summary
QueryResults(GeoIndexType indexTypeObject, List<org.geotools.index.Data> unrefinedResults, Refiner[] refiners, RankEvaluator ranker, RandomAccessFile rawData)
          A Constructor which wraps a list of unrefined results, and assigns the refiners and sorters to be used.
 
Method Summary
 ArrayList<DataWrapper> getAll()
          Returns all results (including previously retrieved), without updating the position marker (ie.
 int getCurrentRefinedCount()
          A method to get the current number of refined hits
 int getCurrentUnrefinedCount()
          A method to get the current number of hits processed
 ArrayList<DataWrapper> getNext(int numberOfResults)
          A method to refine, sort and return a specified number of results
 ArrayList<DataWrapper> getRest()
          Returns the rest of the available results
 int getTotalHitCount()
          A method to get the total number of (unrefined) hits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResults

public QueryResults(GeoIndexType indexTypeObject,
                    List<org.geotools.index.Data> unrefinedResults,
                    Refiner[] refiners,
                    RankEvaluator ranker,
                    RandomAccessFile rawData)
             throws Exception
A Constructor which wraps a list of unrefined results, and assigns the refiners and sorters to be used.

Parameters:
indexTypeObject - - type of geo object
unrefinedResults - - A list of the unrefined results of a query
refiners - - An array of the refiners specified for the query
ranker - - The ranker specified for the query
Throws:
Exception
Method Detail

getNext

public ArrayList<DataWrapper> getNext(int numberOfResults)
A method to refine, sort and return a specified number of results

Parameters:
numberOfResults - - the number of results to return
Returns:
The requested results. Either the number specified, the number available (if less than specified) or NULL (if no more are available)

getRest

public ArrayList<DataWrapper> getRest()
Returns the rest of the available results

Returns:
the available results

getAll

public ArrayList<DataWrapper> getAll()
Returns all results (including previously retrieved), without updating the position marker (ie. getNext() will give the same results regardless of whether getAll() has been called).

Returns:
All the refined results

getTotalHitCount

public int getTotalHitCount()
A method to get the total number of (unrefined) hits

Returns:
the total number of (unrefined) hits

getCurrentRefinedCount

public int getCurrentRefinedCount()
A method to get the current number of refined hits

Returns:
the current number of refined hits

getCurrentUnrefinedCount

public int getCurrentUnrefinedCount()
A method to get the current number of hits processed

Returns:
the current number of hits processed (both those removed and those accepted during the refinement process)


Copyright © 2012. All Rights Reserved.