org.mmbase.storage.search.implementation
Class BasicSortOrder

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.BasicSortOrder
All Implemented Interfaces:
SortOrder

public class BasicSortOrder
extends java.lang.Object
implements SortOrder

Basic implementation.

Since:
MMBase-1.7
Version:
$Id: BasicSortOrder.java,v 1.5 2003/07/14 20:47:11 michiel Exp $
Author:
Rob van Maris

Field Summary
 
Fields inherited from interface org.mmbase.storage.search.SortOrder
ORDER_ASCENDING, ORDER_DESCENDING
 
Constructor Summary
BasicSortOrder(StepField field)
          Constructor.
 
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()
           
 BasicSortOrder setDirection(int direction)
          Sets direction.
 java.lang.String toString()
          Returns a string representation of this SortOrder.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicSortOrder

public BasicSortOrder(StepField field)
Constructor. Creates new BasicSortOrder instance, with direction SortOrder.ORDER_ASCENDING.

Parameters:
field - The associated stepfield.
Throws:
java.lang.IllegalArgumentException - when an invalid argument is supplied.
Method Detail

setDirection

public BasicSortOrder setDirection(int direction)
Sets direction.

Parameters:
direction - The direction.
Returns:
This BasicSortOrder instance.
Throws:
java.lang.IllegalArgumentException - when an invalid argument is supplied.

getField

public StepField getField()
Description copied from interface: SortOrder
Gets the associated field.

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

Specified by:
getField in interface SortOrder

getDirection

public int getDirection()
Description copied from interface: SortOrder
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.

Specified by:
getDirection in interface SortOrder

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: SortOrder
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.

Specified by:
equals in interface SortOrder

hashCode

public int hashCode()
Specified by:
hashCode in interface SortOrder

toString

public java.lang.String toString()
Description copied from interface: SortOrder
Returns a string representation of this SortOrder. The string representation has the form "SortOrder(field:<field>, dir:<dir>)" where

Specified by:
toString in interface SortOrder


MMBase build 1.7.1.20041002