com.ibm.workplace.wcm.api.query
Class Sort

java.lang.Object
  extended by com.ibm.workplace.wcm.api.query.Sort
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EditionSort

public abstract class Sort
extends java.lang.Object
implements java.io.Serializable

Sort implementations are located in api.impl this abstract class delegates the factory methods to a protected interface to keep the API uncluttered

Since:
7.0
See Also:
Serialized Form

Field Summary
static Sort NONE
           
 
Constructor Summary
protected Sort()
          Constructor
protected Sort(SortDirection direction)
          Constructor
 
Method Summary
 boolean congruent(Sort sort)
          returns true if this sort is congruent to the specified Sort.
 boolean equals(java.lang.Object object)
          two sorts are equal if they are congruent and the sort order is the same
 SortDirection getDirection()
           
 SortDirection getOrder()
           
 int hashCode()
          equal sorts have equal hashCodes
 SortDirection reverse()
           
 void setDirection(SortDirection direction)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final Sort NONE
Constructor Detail

Sort

protected Sort()
Constructor


Sort

protected Sort(SortDirection direction)
Constructor

Parameters:
direction - Direction to sort
Method Detail

setDirection

public final void setDirection(SortDirection direction)

getOrder

public final SortDirection getOrder()

reverse

public final SortDirection reverse()

getDirection

public final SortDirection getDirection()

congruent

public boolean congruent(Sort sort)
returns true if this sort is congruent to the specified Sort. Two sorts are congruent if they refer to a Sort by the exact same property. Please note that the order of the sort may be inverted The default implementation checks for equivalence of the class.

Parameters:
sort -
Returns:
true if the two sorts are congruent

equals

public boolean equals(java.lang.Object object)
two sorts are equal if they are congruent and the sort order is the same

Overrides:
equals in class java.lang.Object
Parameters:
object -
Returns:
true if the two sorts are equal

hashCode

public int hashCode()
equal sorts have equal hashCodes

Overrides:
hashCode in class java.lang.Object
Returns:
hashCode

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object