org.mmbase.storage.search
Interface SearchQuery

All Known Subinterfaces:
NodeQuery, Query
All Known Implementing Classes:
BasicNodeQuery, BasicQuery, BasicSearchQuery, ModifiableQuery, NodeSearchQuery

public interface SearchQuery

Encapsulates a request for a search of the object cloud.

This corresponds to a SELECT query in SQL syntax.

Since:
MMBase-1.7
Version:
$Id: SearchQuery.java,v 1.3 2004/04/01 20:57:48 robmaris Exp $
Author:
Rob van Maris

Field Summary
static int DEFAULT_MAX_NUMBER
          Default maxNumber value, corresponds to no maximum.
static int DEFAULT_OFFSET
          Default offset value, corresponds to no offset.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this query to the specified object.
 Constraint getConstraint()
          Gets the constraints on the search results.
 java.util.List getFields()
          Gets the stepfields in the search request.
 int getMaxNumber()
          Gets the maximum number of results to be returned, or -1 if the number of results to be returned is unlimited.
 int getOffset()
          Gets the (zerobased) offset in the list of results, of the first result to return.
 java.util.List getSortOrders()
          Gets the SortOrder objects in the order they are to be applied.
 java.util.List getSteps()
          Gets the steps in the search request.
 int hashCode()
           
 boolean isAggregating()
          Tests if this is an aggregating query, i.e.
 boolean isDistinct()
          Tests if the search request is to return distinct results.
 java.lang.String toString()
          Returns a string representation of this SearchQuery.
 

Field Detail

DEFAULT_MAX_NUMBER

public static final int DEFAULT_MAX_NUMBER
Default maxNumber value, corresponds to no maximum.

See Also:
getMaxNumber(), Constant Field Values

DEFAULT_OFFSET

public static final int DEFAULT_OFFSET
Default offset value, corresponds to no offset.

See Also:
getOffset(), Constant Field Values
Method Detail

isDistinct

public boolean isDistinct()
Tests if the search request is to return distinct results. In that case duplicate nodes will be removed from the result.

This corresponds to the use of "DISTINCT" in SQL SELECT-syntax .


isAggregating

public boolean isAggregating()
Tests if this is an aggregating query, i.e. containing aggregated fields.


getSteps

public java.util.List getSteps()
Gets the steps in the search request.

This corresponds to the tables in SQL SELECT-syntax.


getFields

public java.util.List getFields()
Gets the stepfields in the search request.

This corresponds to the fields in SQL SELECT-syntax.


getConstraint

public Constraint getConstraint()
Gets the constraints on the search results.

This corresponds to (part of) the constraints in the WHERE-clause in SQL SELECT-syntax.


getMaxNumber

public int getMaxNumber()
Gets the maximum number of results to be returned, or -1 if the number of results to be returned is unlimited.

Note: limiting the number of results may not be supported by the database layer.


getOffset

public int getOffset()
Gets the (zerobased) offset in the list of results, of the first result to return. Note that, since it is zerobased, it is equal to the number of results that are skipped.

Note: skipping results may not be supported by the database layer.


getSortOrders

public java.util.List getSortOrders()
Gets the SortOrder objects in the order they are to be applied. This specifies the sorting order of the search results.

This corresponds to the ORDER BY clause in SQL SELECT syntax.


equals

public boolean equals(java.lang.Object obj)
Compares this query to the specified object. The result is true if and only if the argument is a non-null SearchQuery object representing the same query.

Parameters:
obj - The object to compare with.
Returns:
true if the objects are equal, false otherwise.

hashCode

public int hashCode()

toString

public java.lang.String toString()
Returns a string representation of this SearchQuery. The string representation has the form "SearchQuery(distinct:<distinct>, steps:<steps>, fields:<fields>, constraint:<constraint>, sortorders:<sortorders>, max:<max>, offset:<offset>)" where

Returns:
A string representation of this SearchQuery.


MMBase build 1.7.4.20050922