SMILA (incubation) API documentation

org.eclipse.smila.search.api.helper
Class ResultAccessor

java.lang.Object
  extended by org.eclipse.smila.search.api.helper.ResultAccessor

public class ResultAccessor
extends java.lang.Object

Wrapper for a complete search result object. Basically provides method to create access helpers for the single query and result records contained in the search result. Can also create a new query builder based on the effective query object in the search result.

Author:
jschumacher

Constructor Summary
ResultAccessor(SearchResult result)
          create instance.
 
Method Summary
 QueryRecordAccessor getQuery()
          create a wrapper for the effective query record.
 SearchResult getResult()
          access original result.
 ResultRecordAccessor getResultRecord(int index)
          create a wrapper for the n'th result record.
 java.lang.String getWorkflowName()
           
 boolean hasQuery()
           
 boolean hasRecords()
           
 QueryBuilder newQueryBuilder()
          create new QueryBuilder for same pipeline from effective query object of this result, use complete query object.
 QueryBuilder newQueryBuilder(java.lang.String recordFilterName)
          create new QueryBuilder for same pipeline from effective query object of this result, keep only parts of query object as described by record filter. parameters are always copied.
 int recordsSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultAccessor

public ResultAccessor(SearchResult result)
create instance.

Parameters:
result - the search result.
Method Detail

getResult

public SearchResult getResult()
access original result.

Returns:
the search result.

getWorkflowName

public java.lang.String getWorkflowName()
Returns:
name of pipeline that produced the search result.

hasQuery

public boolean hasQuery()
Returns:
true if the search result contains an effective query object, null else.

getQuery

public QueryRecordAccessor getQuery()
create a wrapper for the effective query record.

Returns:
wrapper for query, or null, if no query is present.

hasRecords

public boolean hasRecords()
Returns:
true if the result contains a (possibly empty) records list. false, if no records list is present.

recordsSize

public int recordsSize()
Returns:
number of result records.

getResultRecord

public ResultRecordAccessor getResultRecord(int index)
create a wrapper for the n'th result record.

Parameters:
index - position in result list.
Returns:
wrapper for the result record, or null if index in invalid.

newQueryBuilder

public QueryBuilder newQueryBuilder()
create new QueryBuilder for same pipeline from effective query object of this result, use complete query object.

Returns:
new query builder.

newQueryBuilder

public QueryBuilder newQueryBuilder(java.lang.String recordFilterName)
create new QueryBuilder for same pipeline from effective query object of this result, keep only parts of query object as described by record filter. parameters are always copied.

Parameters:
recordFilterName - name of filter to apply to effective query record.
Returns:
new query builder.

SMILA (incubation) API documentation