com.endeca.portal.data
Class QueryResults

java.lang.Object
  extended by com.endeca.portal.data.QueryResults

public class QueryResults
extends java.lang.Object

An API-agnostic wrapper of query results. This class doesn't permit any real interaction with the contained results, except for determining which API version the contained results are compatible with and returning those results.

See Also:
DataSource, QueryState

Constructor Summary
QueryResults(com.endeca.navigation.ENEQueryResults results)
          Construct a QueryResults object with results from the ENE presentation API.
QueryResults(com.endeca.mdex.conversation.Results results)
          Construct a QueryResults object with results from the Discovery Service API.
 
Method Summary
 com.endeca.mdex.conversation.Results getDiscoveryServiceResults()
          Get the wrapped discovery service results.
 com.endeca.navigation.ENEQueryResults getENEQueryResults()
          Get the wrapped ENEQueryResults.
 MDEXState.APIVersion getVersion()
          Get what APIVersion this data source supports.
 boolean isDiscoveryService()
           
 boolean isENEQuery()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResults

public QueryResults(com.endeca.navigation.ENEQueryResults results)
Construct a QueryResults object with results from the ENE presentation API.

Parameters:
results - the results to wrap.

QueryResults

public QueryResults(com.endeca.mdex.conversation.Results results)
Construct a QueryResults object with results from the Discovery Service API.

Parameters:
results - the results to wrap.
Method Detail

getENEQueryResults

public com.endeca.navigation.ENEQueryResults getENEQueryResults()
Get the wrapped ENEQueryResults. Will be null if this instance doesn't wrap ENEQueryResults.

Returns:
the wrapped ENEQueryResults

getDiscoveryServiceResults

public com.endeca.mdex.conversation.Results getDiscoveryServiceResults()
Get the wrapped discovery service results. Will be null if this instance doesn't wrap discovery service results.

Returns:
the wrapped discovery service results

getVersion

public MDEXState.APIVersion getVersion()
Get what APIVersion this data source supports. For branching portlet code based on API support, we recommend using isENEQuery() or isDiscoveryService() instead of this method.

Returns:
the APIVersion of this data source.

isDiscoveryService

public boolean isDiscoveryService()
Returns:
true if this instance wraps MDEX 7 Discovery Service results, false otherwise.

isENEQuery

public boolean isENEQuery()
Returns:
true if this instance wraps ENEQuery API results, false otherwise.