public final class SearchSortSpecification extends Object implements Cloneable, Serializable
// Usage Examples. // // Following code shows a SearchSortSpecification which represents // ORDER by DOCUMENT.NAME, FOLDER.NAME // // Array of classes involved in the order by clause // Remember to use aliases if they are specified. String [] sortClasses = new String[] {"DOCUMENT", "FOLDER"} // // Array of Attribute Names to match class names. String [] attNames = new String[] {"NAME", "NAME"} // // Order of Sort for each sort element boolean [] orders = new boolean[] {true, false} // // Create the SortSpecification SearchSortSpecification someSortSpec = new SearchSortSpecification(sortClasses, attNames, orders); // To do case insensitive sorting, use the constructor or add method // variant that takes a sqlfunction as parameter and pass nls_upper // as the name of the sql function that needs to be used. someSortSpec.add(Document.CLASS_NAME, "NAME", true, "nls_upper"); // To sort based on Context scores, look for example in javadoc of // ContextQualification.
Modifier and Type | Field and Description |
---|---|
static boolean |
ASCENDING |
static boolean |
DESCENDING |
protected Vector |
m_Attributes
The Sort Attributes.
|
protected Vector |
m_Classes
The classes of the sort Attributes.
|
protected String |
m_DefaultClass
The default Search Class.
|
protected Vector |
m_Orders
The Sort Orders.
|
protected Vector |
m_SqlFunctions
Sql functions that may be used with the sort.
|
Constructor and Description |
---|
SearchSortSpecification()
Constructs a SearchSortSpecification, calls this(null).
|
SearchSortSpecification(String defaultClass)
Constructs a SearchSortSpecification.
|
SearchSortSpecification(String[] classes,
String[] attributes,
boolean[] orders)
Constructs a SearchSortSpecification.
|
SearchSortSpecification(String[] classes,
String[] attributes,
boolean[] orders,
String[] functions)
Constructs a SearchSortSpecification.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String[] sortAttributes,
boolean[] sortOrders)
Adds the unqualified attributes to the sort list.
|
void |
add(String[] sortClasses,
String[] sortAttributes,
boolean[] sortOrders)
Add Attributes to sort list.
|
void |
add(String[] sortClasses,
String[] sortAttributes,
boolean[] sortOrders,
String[] sortFunctions)
Add Attributes to sort list.
|
void |
add(String sortAttribute,
boolean sortOrder)
Adds the unqualified attribute to the end of the sort list.
|
void |
add(String sortClass,
String sortAttribute,
boolean sortOrder)
Add an attribute to the end of the sort list.
|
void |
add(String sortClass,
String sortAttribute,
boolean sortOrder,
String sqlFunction)
Add an attribute to the end of the sort list.
|
Object |
clone()
Returns a clone of this SearchClassSpecification.
|
String[] |
getAttributeNames()
Gets the list of Sort Attribute names.
|
String[] |
getClassnames()
Returns the Class names of the sort Attributes.
|
boolean[] |
getOrders()
Returns the sort Orders of the Sort Attributes.
|
String[] |
getSqlFunctions()
Gets the list of sql function names.
|
public static boolean ASCENDING
public static boolean DESCENDING
protected Vector m_Classes
protected Vector m_Attributes
protected Vector m_Orders
protected String m_DefaultClass
protected Vector m_SqlFunctions
public SearchSortSpecification(String defaultClass)
defaultClass
- default Class for sort Attributespublic SearchSortSpecification()
public SearchSortSpecification(String[] classes, String[] attributes, boolean[] orders) throws IfsException
classes
- Classes for the sort Attributesattributes
- Sort Attributesorders
- Sort Order for each attribute, true implies ascending,
false implies descending.IfsException
- if adding sort Attributes fails.public SearchSortSpecification(String[] classes, String[] attributes, boolean[] orders, String[] functions) throws IfsException
classes
- Classes for the sort Attributesattributes
- Sort Attributesorders
- Sort Order for each attribute, true implies ascending,
false implies descending.functions
- Sql function that is to be wrapped around each functionIfsException
- if adding sort Attributes fails.public void add(String[] sortClasses, String[] sortAttributes, boolean[] sortOrders, String[] sortFunctions) throws IfsException
add on each attribute in the list.
sortClasses
- list of classes, each entry specifies the class of the
corresponding entry in the attribute list.sortAttributes
- list of sort AttributessortOrders
- order of sorting attribute, true implies ascending,
false implies descending. If this null, then ascending
is assumed for all attributes.sortFunctions
- sql functions that need to be wrapped around the attributesIfsException
- if operation failspublic void add(String[] sortClasses, String[] sortAttributes, boolean[] sortOrders) throws IfsException
add on each attribute in the list.
sortClasses
- list of classes, each entry specifies the class of the
corresponding entry in the attribute list.sortAttributes
- list of sort AttributessortOrders
- order of sorting attribute, true implies ascending,
false implies descending. If this null, then ascending
is assumed for all attributes.IfsException
- if operation failspublic void add(String[] sortAttributes, boolean[] sortOrders) throws IfsException
sortAttributes
- list of sort AttributessortOrders
- order of sorting attributeIfsException
- if operation failsadd(String[], String[], boolean[])
public void add(String sortClass, String sortAttribute, boolean sortOrder, String sqlFunction) throws IfsException
sortClass
- Class of attribute, defaultClass is used if this is null.sortAttribute
- sort AttributesortOrder
- order of sorting, true implies ascending, false implies
descendingsqlFunction
- any sql function call that needs to be wrapped around the
attribute; Use "nls_upper" function to sort case insensitively.IfsException
- is the operation failspublic void add(String sortClass, String sortAttribute, boolean sortOrder) throws IfsException
sortClass
- Class of attribute, defaultClass is used if this is null.sortAttribute
- sort AttributesortOrder
- order of sorting, true implies ascending, false implies
descendingIfsException
- is the operation failspublic void add(String sortAttribute, boolean sortOrder) throws IfsException
sortAttribute
- sort AttributesortOrder
- order of sorting, true implies ascending, false implies
descendingIfsException
- if the operation failspublic String[] getClassnames() throws IfsException
IfsException
- if the operation failspublic String[] getAttributeNames() throws IfsException
IfsException
- if the operation failspublic String[] getSqlFunctions() throws IfsException
IfsException
- if the operation failspublic boolean[] getOrders() throws IfsException
IfsException
- if the operation failsCopyright © 2023. All rights reserved.