© 2005 BEA Systems, Inc.

com.bea.p13n.content.document.ref
Class DocumentComparator

java.lang.Object
  extended bycom.bea.p13n.content.document.ref.DocumentComparator
All Implemented Interfaces:
Comparator

public class DocumentComparator
extends Object
implements Comparator

A comparator which can sort DocumentMetadataDefs according to a list of SortCriteria.

This will not be a fast comparator due to the nature of the objects it supports. It is recommended to try to get the database to do as much sorting as possible.

Since:
2.0

Field Summary
protected  SortCriteria[] criteria
          Deprecated. The SortCriteria this uses.
 
Constructor Summary
DocumentComparator(SortCriteria[] criteria)
          Deprecated. Constructor.
DocumentComparator(String sortBy)
          Deprecated. Constructor.
 
Method Summary
 int compare(Object obj1, Object obj2)
          Deprecated. Compare two DocumentMetadataDef objects according to the sort criteria.
 String toString()
          Deprecated. Get a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

criteria

protected SortCriteria[] criteria
Deprecated. 
The SortCriteria this uses.

Constructor Detail

DocumentComparator

public DocumentComparator(SortCriteria[] criteria)
Deprecated. 
Constructor.


DocumentComparator

public DocumentComparator(String sortBy)
                   throws IllegalArgumentException
Deprecated. 
Constructor.

Throws:
IllegalArgumentException
See Also:
SortCriteria.getSortCriteria(java.lang.String)
Method Detail

compare

public int compare(Object obj1,
                   Object obj2)
            throws ClassCastException
Deprecated. 
Compare two DocumentMetadataDef objects according to the sort criteria.

Specified by:
compare in interface Comparator
Parameters:
obj1 - the first object.
obj2 - the second object.
Returns:
-1 if obj1 less than obj2, 0 if equals, 1 if greater than.
Throws:
ClassCastException - thrown if either obj1 or obj2 is not a DocumentMetadataDef.

toString

public String toString()
Deprecated. 
Get a string representation.


© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved