org.apache.beehive.netui.databinding.datagrid.api.sort
Class Sort

Object
  extended by Sort
All Implemented Interfaces:
Serializable

public class Sort
extends Object
implements Serializable

The Sort class is a JavaBean that abstractly represents the data needed to calculate a sort on some data set. A sort consists of some String expression and a SortDirection. The mechanism for performing the sort is not provided here.

A Sort object can be used by some sorting infrastructure to either parameterise a SQL or XQuery query or to simply sort in-memory Java objects. For example, when converting a Sort into a SQL fragment, a Sort with sortExpression "foo" and sortDirection SortDirection.DESCENDING could be converted into:

     ORDER BY FOO DESC
 

See Also:
Serialized Form

Constructor Summary
Sort()
          Empty constructor.
Sort(String sortExpression, SortDirection sortDirection)
          Constructs a Sort with the given sortExpression and sortDirection.
 
Method Summary
 SortDirection getDirection()
          Get the SortDirection
 String getSortExpression()
          Get the sort expression
 void setDirection(SortDirection sortDirection)
          Set the SortDirection
 void setSortExpression(String expression)
          Set the sort expression
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sort

public Sort()
Empty constructor.


Sort

public Sort(String sortExpression,
            SortDirection sortDirection)
Constructs a Sort with the given sortExpression and sortDirection.

Parameters:
sortExpression - the Sort's sort expression
sortDirection - the Sort's sort direction
Method Detail

getSortExpression

public String getSortExpression()
Get the sort expression

Returns:
the sort expression

setSortExpression

public void setSortExpression(String expression)
Set the sort expression

Parameters:
expression - the sort expression

getDirection

public SortDirection getDirection()
Get the SortDirection

Returns:
the sort direction

setDirection

public void setDirection(SortDirection sortDirection)
Set the SortDirection

Parameters:
sortDirection - the sort direction