org.mmbase.storage.search
Interface SortOrder

All Known Implementing Classes:
BasicSortOrder

public interface SortOrder

A sortorder specifies sorting of a single field.

This corresponds to use of ORDER BY in SQL SELECT-syntax.

Since:
MMBase-1.7
Version:
$Id: SortOrder.java,v 1.2 2003/03/10 11:50:51 pierre Exp $
Author:
Rob van Maris

Field Summary
static int ORDER_ASCENDING
           
static int ORDER_DESCENDING
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this sortorder to the specified object.
 int getDirection()
          Gets the sort direction.
 StepField getField()
          Gets the associated field.
 int hashCode()
           
 java.lang.String toString()
          Returns a string representation of this SortOrder.
 

Field Detail

ORDER_ASCENDING

public static final int ORDER_ASCENDING
See Also:
Constant Field Values

ORDER_DESCENDING

public static final int ORDER_DESCENDING
See Also:
Constant Field Values
Method Detail

getField

public StepField getField()
Gets the associated field.

This corresponds to a fieldname in a "ORDER BY" clause in SQL SELECT-syntax.


getDirection

public int getDirection()
Gets the sort direction. This is be either ORDER_ASCENDING or ORDER_DESCENDING.

This corresponds to the use of ASC and DESC in SQL SELECT-syntax.


equals

public boolean equals(java.lang.Object obj)
Compares this sortorder to the specified object. The result is true if and only if the argument is a non-null SortOrder object associated with the same field, using the same sort direction.

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 SortOrder. The string representation has the form "SortOrder(field:<field>, dir:<dir>)" where

Returns:
A string representation of this SortOrder.


MMBase build 1.7.4.20050922