Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.content.expression
Class SortCriteria

    java.lang.Object
      com.bea.content.expression.SortCriteria

All Implemented Interfaces
  Serializable, Cloneable, Comparable

    public class SortCriteria

extends Object
implements Cloneable, Comparable, Serializable

A class which handles the sortBy part of a Search.

This object represents a single sort criteria, which is a property name and an ascending/descending flag. If not using full text search, the property must either be a system property or an explicit property.

System properties are enumeraed in the com.bea.content.expression.IMetadataQuery class.

Explicit properties may be specified by the user, in addition to those that exist OOTB: "cm_nodeName", "cm_value","cm_lifeCycleStatus", "cm_isContent", "cm_isHierarchy", "cm_isHierarchy", "cm_objectClass", "cm_path", "cm_createdBy", "cm_createdDate", "cm_objectClassInstance", "cm_parent_uid", "cm_version", "cm_versionComment", "cm_checkedOut", "cm_assignedToUser", "cm_role", "cm_uid", "cm_modifiedBy", "cm_modifiedDate", "cm_contentType", "cm_binarySize", "cm_binaryName"

For more complex queries, rather than SortCriteria, use the Search constructor that takes a sort string. See the javadocs on the Search class for examples.

See Also
  Serialized Form

Field Summary
`boolean` | `isAscending` The ascending or descending order.
`String` | `propertyName` The property name to sort on.
`String` | `propertySet` The property set name.

Constructor Summary
`SortCriteria(String propertyName)` Constructor.
`SortCriteria(String propertyName, boolean isAscending)` Constructor.
`SortCriteria(String propertySet, String propertyName, boolean isAscending)` Deprecated The property set is no longer being used in SortCriteria

Method Summary
`Object` | `clone()` Clone this object.
`int` | `compareTo(Object obj)` Compare this object to another object.
`boolean` | `equals(Object o)` Determine if this object is equal to another object.
`static SortCriteria[]` | `getSortCriteria(String sortBy)` Parse the given sort string and return an array of SortCriteria.
`int` | `hashCode()` Override the hashCode because we override equals().
`String` | `toString()` Convert to a string.
`static String` | `toString(SortCriteria[] sort)` Convert an array of sort criteria to a sort clause.

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### propertySet

    public String propertySet

  The property set name.

### propertyName

    public String propertyName

  The property name to sort on.

### isAscending

    public boolean isAscending

  The ascending or descending order.

Constructor Detail

### SortCriteria

    @Deprecated
    public SortCriteria(String propertySet,
                                   String propertyName,
                                   boolean isAscending)

  Deprecated The property set is no longer being used in SortCriteria

  Constructor.

  Parameters
    `propertySet` - The property set to sort on. No longer used.
    `propertyName` - The property name to sort on.
    `isAscending` - True if this should sort ascending. Defaults to true.

### SortCriteria

    public SortCriteria(String propertyName,
                        boolean isAscending)

  Constructor.

  Parameters
    `propertyName` - The property name to sort on.
    `isAscending` - True if this should sort ascending. Defaults to true.

### SortCriteria

    public SortCriteria(String propertyName)

  Constructor.

  Parameters
    `propertyName` - The property name to sort on.

Method Detail

### clone

    public Object clone()

  Clone this object.

  Overrides:
    `clone` in class `Object`

### compareTo

    public int compareTo(Object obj)

  Compare this object to another object.

  Specified by:
    `compareTo` in interface `Comparable`

### equals

    public boolean equals(Object o)

  Determine if this object is equal to another object.

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Override the hashCode because we override equals().

  Overrides:
    `hashCode` in class `Object`

### getSortCriteria

    public static SortCriteria[] getSortCriteria(String sortBy)
                                          throws IllegalArgumentException

  Parse the given sort string and return an array of SortCriteria.

  Parameters
    `sortBy` - the sort string (e.g. "identifier ASC, creationDate DESC").
  Returns
    the array of SortCriteria.
  Throws
    `IllegalArgumentException` - thrown on an invalid sortBy string.

### toString

    public String toString()

  Convert to a string.

  Overrides:
    `toString` in class `Object`

### toString

    public static String toString(SortCriteria[] sort)

  Convert an array of sort criteria to a sort clause.

  This will return a sort clause that, if parsed, will return the equivalent SortCriteria objects as those passed. It will not, however, neccessarily be the same sort clause that might have generated the incoming SortCriteria.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.