com.mkdoc.query
Class SimpleQuery

java.lang.Object
  |
  +--com.mkdoc.query.SimpleQuery
All Implemented Interfaces:
Query, QueryContext

public class SimpleQuery
extends java.lang.Object
implements Query

A simple query implementation.

Version:
0.4 2005-08-02
Author:
Philip Shaw

Field Summary
 
Fields inherited from interface com.mkdoc.query.Query
VAR_SUMMARY, VAR_TITLE, VAR_URI
 
Fields inherited from interface com.mkdoc.query.QueryContext
HTML, LIMIT, RSS, TEXT
 
Constructor Summary
SimpleQuery(java.lang.String query, java.lang.String resultKey, QueryContext context)
          Construct with a literal query and URI.
 
Method Summary
 java.lang.String getOutputType()
          Get the requested output format for the result.
 int getPageNumber()
          Get the requested page number for any results.
 java.lang.String getQueryUri()
          Get a unique request URI for the query.
 java.lang.String getQueryUri(int page)
          Get a request URI for a result set by page number.
protected  java.lang.String getQueryUri(int page, int limit)
          Get a request URI for a result set by page number.
 java.lang.String getResultKey()
          Get the unique result key for the query.
 int getResultsPerPage()
          Get the maximum number of results to display per page.
 java.lang.String getSeRQLQuery()
          Get an SeRQL query statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleQuery

public SimpleQuery(java.lang.String query,
                   java.lang.String resultKey,
                   QueryContext context)
Construct with a literal query and URI.

Parameters:
query - The literal query to wrap.
resultKey - A distinct result key in the form of a query URI, without output type and paging information.
context - The output context for the query.
Since:
Version 0.1 2005-07-05
Method Detail

getSeRQLQuery

public final java.lang.String getSeRQLQuery()
Get an SeRQL query statement.

Specified by:
getSeRQLQuery in interface Query
Returns:
An SeRQL query statement.
Since:
Version 0.1 2005-07-05

getResultKey

public final java.lang.String getResultKey()
Get the unique result key for the query.

Specified by:
getResultKey in interface Query
Returns:
A unique key for the query result in the form of a URI without output type or paging information.
Since:
Version 0.4 2005-08-01

getQueryUri

public final java.lang.String getQueryUri()
Get a unique request URI for the query.

Specified by:
getQueryUri in interface Query
Returns:
A unique URI for the query.
Since:
Version 0.2 2005-07-26

getQueryUri

public final java.lang.String getQueryUri(int page)
Get a request URI for a result set by page number.

Specified by:
getQueryUri in interface Query
Parameters:
page - The page number for which to render a query URI.
Returns:
A unique URI for the query.
Since:
Version 0.2 2005-07-26

getQueryUri

protected final java.lang.String getQueryUri(int page,
                                             int limit)
Get a request URI for a result set by page number.

Parameters:
page - The page number for which to render a query URI.
limit - The number of results per page for the query.
Returns:
A unique URI for the query.
Since:
Version 0.2 2005-07-26

getPageNumber

public final int getPageNumber()
Get the requested page number for any results.

Specified by:
getPageNumber in interface QueryContext
Returns:
The page number for any results
Since:
Version 0.3 2005-08-01

getResultsPerPage

public final int getResultsPerPage()
Get the maximum number of results to display per page.

Specified by:
getResultsPerPage in interface QueryContext
Returns:
The maximum number of results to display per page.
Since:
Version 0.3 2005-08-01

getOutputType

public final java.lang.String getOutputType()
Get the requested output format for the result.

Specified by:
getOutputType in interface QueryContext
Returns:
The output type for the result.
Since:
Version 0.4 2005-08-01