FileDocCategorySizeDatePackage
SortKey.javaAPI DocJava SE 5 API2873Fri Aug 26 14:57:40 BST 2005javax.naming.ldap

SortKey

public class SortKey extends Object
A sort key and its associated sort parameters. This class implements a sort key which is used by the LDAPv3 Control for server-side sorting of search results as defined in RFC 2891.
since
1.5
see
SortControl
author
Vincent Ryan

Fields Summary
private String
attrID
private boolean
reverseOrder
private String
matchingRuleID
Constructors Summary
public SortKey(String attrID)
Creates the default sort key for an attribute. Entries will be sorted according to the specified attribute in ascending order using the ordering matching rule defined for use with that attribute.

param
attrID The non-null ID of the attribute to be used as a sort key.


                                    		           		     
       
	this.attrID = attrID;
    
public SortKey(String attrID, boolean ascendingOrder, String matchingRuleID)
Creates a sort key for an attribute. Entries will be sorted according to the specified attribute in the specified sort order and using the specified matching rule, if supplied.

param
attrID The non-null ID of the attribute to be used as a sort key.
param
ascendingOrder If true then entries are arranged in ascending order. Otherwise there are arranged in descending order.
param
matchingRuleID The possibly null ID of the matching rule to use to order the attribute values. If not specified then the ordering matching rule defined for the sort key attribute is used.


	this.attrID = attrID;
	reverseOrder = (! ascendingOrder);
	this.matchingRuleID = matchingRuleID;
    
Methods Summary
public java.lang.StringgetAttributeID()
Retrieves the attribute ID of the sort key.

return
The non-null Attribute ID of the sort key.

	return attrID;
    
public java.lang.StringgetMatchingRuleID()
Retrieves the matching rule ID used to order the attribute values.

return
The possibly null matching rule ID. If null then the ordering matching rule defined for the sort key attribute is used.

	return matchingRuleID;
    
public booleanisAscending()
Determines the sort order.

return
true if the sort order is ascending, false if descending.

	return (! reverseOrder);