org.opends.server.types
Class SortOrder

java.lang.Object
  extended by org.opends.server.types.SortOrder

@PublicAPI(stability=VOLATILE,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public final class SortOrder
extends java.lang.Object

This class defines a data structure that defines a set of sort criteria that may be used to order entries in a set of search results. The sort order object is comprised of one or more sort keys, which indicate which attribute types should be used to perform the sort and information about the ordering to use for those attributes. If the sort order has multiple sort keys, then the first sort key will be used as the primary sort criteria, and the second will only be used in cases where the values of the attribute associated with the first sort key are equal, the third will only be used if the first and second values are equal, etc. If all of the sort key attributes for two entries are identical, then the relative order for those entries is undefined.


Constructor Summary
SortOrder(SortKey sortKey)
          Creates a new sort order with a single key.
SortOrder(SortKey[] sortKeys)
          Creates a new sort order with the provided set of sort keys.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether this sort order is equal to the provided object.
 SortKey[] getSortKeys()
          Retrieves the sort keys for this sort order.
 int hashCode()
          Retrieves the hash code for this sort order.
 java.lang.String toString()
          Retrieves a string representation of this sort order.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this sort order to the provided buffer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortOrder

public SortOrder(SortKey sortKey)
Creates a new sort order with a single key.

Parameters:
sortKey - The sort key to use in this sort order.

SortOrder

public SortOrder(SortKey[] sortKeys)
Creates a new sort order with the provided set of sort keys.

Parameters:
sortKeys - The set of sort keys to use for this sort order.
Method Detail

getSortKeys

public SortKey[] getSortKeys()
Retrieves the sort keys for this sort order.

Returns:
The sort keys for this sort order.

toString

public java.lang.String toString()
Retrieves a string representation of this sort order.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this sort order.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this sort order to the provided buffer.

Parameters:
buffer - The buffer to which the information should be appended.

hashCode

public int hashCode()
Retrieves the hash code for this sort order.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code for this sort order.

equals

public boolean equals(java.lang.Object o)
Indicates whether this sort order is equal to the provided object.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object for which to make the determination.
Returns:
true if the provide object is equal to this sort order, or false if it is not.