org.mmbase.storage.search.implementation
Class BasicSortOrder

java.lang.Object
  extended by org.mmbase.storage.search.implementation.BasicSortOrder
All Implemented Interfaces:
Serializable, SortOrder
Direct Known Subclasses:
BasicDateSortOrder

public class BasicSortOrder
extends Object
implements SortOrder, Serializable

Basic implementation.

Since:
MMBase-1.7
Version:
$Id: BasicSortOrder.java 41982 2010-04-20 14:05:14Z michiel $
Author:
Rob van Maris
See Also:
Serialized Form

Field Summary
protected  boolean modifiable
           
 
Fields inherited from interface org.mmbase.storage.search.SortOrder
ORDER_ASCENDING, ORDER_DESCENDING, ORDER_DESCRIPTIONS
 
Constructor Summary
BasicSortOrder(StepField field)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
          Compares this sortorder to the specified object.
 int getDirection()
          Gets the sort direction.
 String getDirectionDescription()
          Returns a description of the direction of the sort order
 StepField getField()
          Gets the associated field.
 int hashCode()
           
 boolean isCaseSensitive()
          Whether sorting must happen case sensitivily.
 BasicSortOrder setCaseSensitive(boolean c)
           
 BasicSortOrder setDirection(int direction)
          Sets direction.
 void setUnmodifiable()
           
 String toString()
          Returns a string representation of this SortOrder.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

modifiable

protected boolean modifiable
Constructor Detail

BasicSortOrder

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

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

setUnmodifiable

public void setUnmodifiable()
Specified by:
setUnmodifiable in interface SortOrder
Since:
MMBase-1.9.2

setDirection

public BasicSortOrder setDirection(int direction)
Sets direction.

Parameters:
direction - The direction.
Returns:
This BasicSortOrder instance.
Throws:
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

getDirectionDescription

public String getDirectionDescription()
Returns a description of the direction of the sort order


isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: SortOrder
Whether sorting must happen case sensitivily. If not, normally something like ordering on the uppercased field will happen.

Specified by:
isCaseSensitive in interface SortOrder

setCaseSensitive

public BasicSortOrder setCaseSensitive(boolean c)
Since:
MMBase-1.8

equals

public boolean equals(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
Overrides:
equals in class Object
Parameters:
obj - The object to compare with.
Returns:
true if the objects are equal, false otherwise.

hashCode

public int hashCode()
Specified by:
hashCode in interface SortOrder
Overrides:
hashCode in class Object

toString

public 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
Overrides:
toString in class Object
Returns:
A string representation of this SortOrder.


MMBase 2.0-SNAPSHOT - null