com.novell.admin.ns
Class OEComparator

java.lang.Object
  extended bycom.novell.admin.ns.OEComparator
All Implemented Interfaces:
java.util.Comparator

public class OEComparator
extends java.lang.Object
implements java.util.Comparator

Comparator to sort an ArrayList of ObjectEntry objects from a subtree search by class and/or name.

The class and name comparisons order accented characters according to the current locale. The comparison is case-insensitive.

The constructor takes a key value that determines how to sort. These constants are defined in the ResultModifier class.

SORTBY_KEY_UNSORTED (0) - No sorting is required. Objects are returned in the same order as sent by the server.

SORTBY_KEY_TYPE (1) - Sort by class only.

SORTBY_KEY_NAME (2) - Sort by name only.

SORTBY_KEY_TYPE_NAME (3) - Sort first by class, then by name.

This comparator does not impose a total ordering. Therefore it can be used to sort a List, but not a SortedSet.


Constructor Summary
OEComparator(int key, AdminNamespace namespace)
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares its two arguments for order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

OEComparator

public OEComparator(int key,
                    AdminNamespace namespace)
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
            throws java.lang.ClassCastException
Compares its two arguments for order.

Specified by:
compare in interface java.util.Comparator
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Throws:
java.lang.ClassCastException - if the arguments' types prevent them from being compared by this Comparator.


API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.