SHOW Signed

net.rim.device.api.ldap
Class LDAPComparator

java.lang.Object
  |
  +--net.rim.device.api.ldap.LDAPComparator
All Implemented Interfaces:
Comparator

public class LDAPComparator
extends Object
implements Comparator

Contains the functionality required for comparing LDAP objects. This object is used for sorting LDAPEntry objects according to one or many of their attributes.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 4.0.0

Constructor Summary
 Category: Signed LDAPComparator(String[] sortAttributes)
          Creates an LDAPComparator object given the list of sort attributes to use.
 
Method Summary
 Category: Signed  int compare(Object o1, Object o2)
          Compares two LDAPEntry objects.
 Category: Signed  boolean equals(Object o1)
          Returns a boolean denoting whether the object passed into this method is equal to the current object.
 Category: Signed  String[] getSortFields()
          Returns the attributes used to compare objects.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPComparator

public LDAPComparator(String[] sortAttributes)
Creates an LDAPComparator object given the list of sort attributes to use.

For example, to sort according to givenname followed by sn, use the following code: LDAPComparator cmp = new LDAPComparator(new String[] {"givenname","sn"});

If passed an empty array of strings, all objects will be reported as equal.

Parameters:
sortFields - An array of Strings representing the sorting attributes. Must be non-null.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

getSortFields

public String[] getSortFields()
Returns the attributes used to compare objects.

Returns:
An array of Strings representing the sorting attributes values.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

compare

public int compare(Object o1,
                   Object o2)
Compares two LDAPEntry objects.

Parameters:
o1 - First object to compare
o2 - First object to compare
Returns:
Returns -1 if (o1 < o2); 0 if (o1 == o2); -1 if (o1 > 02)
Throws:
ClassCastException - - If either of the two objects are not LDAPEntry objects
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

equals

public boolean equals(Object o1)
Returns a boolean denoting whether the object passed into this method is equal to the current object.
Specified by:
equals in interface Comparator
Overrides:
equals in class Object
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.