org.mmbase.storage.search
Interface SortOrder

All Known Subinterfaces:
DateSortOrder
All Known Implementing Classes:
BasicDateSortOrder, 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 41989 2010-04-20 16:45:39Z michiel $
Author:
Rob van Maris

Field Summary
static int ORDER_ASCENDING
          Order for ascending sort order.
static int ORDER_DESCENDING
          Order for descending sort order.
static String[] ORDER_DESCRIPTIONS
          Order descriptions corresponding to the order values: ORDER_ASCENDING, and ORDER_DESCENDING
 
Method Summary
 boolean equals(Object obj)
          Compares this sortorder to the specified object.
 int getDirection()
          Gets the sort direction.
 StepField getField()
          Gets the associated field.
 int hashCode()
           
 boolean isCaseSensitive()
          Whether sorting must happen case sensitivily.
 void setUnmodifiable()
           
 String toString()
          Returns a string representation of this SortOrder.
 

Field Detail

ORDER_ASCENDING

static final int ORDER_ASCENDING
Order for ascending sort order.

See Also:
Constant Field Values

ORDER_DESCENDING

static final int ORDER_DESCENDING
Order for descending sort order.

See Also:
Constant Field Values

ORDER_DESCRIPTIONS

static final String[] ORDER_DESCRIPTIONS
Order descriptions corresponding to the order values: ORDER_ASCENDING, and ORDER_DESCENDING

Method Detail

getField

StepField getField()
Gets the associated field.

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


getDirection

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.


isCaseSensitive

boolean isCaseSensitive()
Whether sorting must happen case sensitivily. If not, normally something like ordering on the uppercased field will happen.

Since:
MMBase-1.8

equals

boolean equals(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.

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

hashCode

int hashCode()
Overrides:
hashCode in class Object

toString

String toString()
Returns a string representation of this SortOrder. The string representation has the form "SortOrder(field:<field>, dir:<dir>)" where

Overrides:
toString in class Object
Returns:
A string representation of this SortOrder.

setUnmodifiable

void setUnmodifiable()
Since:
MMBase-1.9.2


MMBase 2.0-SNAPSHOT - null