com.adobe.repository.query.sort
Class SortOrder

java.lang.Object
  extended by com.adobe.repository.query.sort.SortOrder
All Implemented Interfaces:
java.io.Serializable

public class SortOrder
extends java.lang.Object
implements java.io.Serializable

An object representation of a SQL ORDER BY clause, which is used with Query objects. It can be used as shown in the following example:

final boolean ASCENDING = true;
final boolean DESCENDING = false;
SortOrder so = new SortOrder();
so.addSortElement(new SortOrder.Element(Resource.ATTRIBUTE_NAME, ASCENDING));
so.addSortElement(new SortOrder.Element(Resource.ATTRIBUTE_MAJOR_VERSION, DESCENDING));
so.addSortElement(new SortOrder.Element(Resource.ATTRIBUTE_MINOR_VERSION, DESCENDING));

Since:
8.0
See Also:
Serialized Form

Nested Class Summary
static class SortOrder.Element
          An element of an ORDER BY clause, indicating one column to be sorted as well as its direction (ascending or descending) .
 
Constructor Summary
SortOrder()
          Default constructor that creates a new, empty SortOrder object.
 
Method Summary
 void addSortElement(SortOrder.Element element)
          Appends a SortOrder.Element to the list of sorts applied to the query.
 void clearSortOrder()
          Removes all the elements that exist in this object.
 java.util.List getSortOrder()
          Retrieves the list of sort order elements.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortOrder

public SortOrder()
Default constructor that creates a new, empty SortOrder object.

Method Detail

addSortElement

public void addSortElement(SortOrder.Element element)
Appends a SortOrder.Element to the list of sorts applied to the query.

Parameters:
element - A SortOrder.Element instance representing the sort order element.

clearSortOrder

public void clearSortOrder()
Removes all the elements that exist in this object.


getSortOrder

public java.util.List getSortOrder()
Retrieves the list of sort order elements.

Returns:
An ordered list of SortOrder.Element objects, stored in the order they were added.


[an error occurred while processing this directive] [an error occurred while processing this directive]