Compoze Software, Inc.

com.compoze.collab
Class ItemComparator


java.lang.Object

  |

  +--com.compoze.collab.ItemComparator

All Implemented Interfaces:
java.util.Comparator

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

Comparator for arbitrary properties on items. Items are compared by one or more property values. The following sort criteria is used for each of the different property value types:

Value Type Sort Criteria
Key.VALUE_STRING Comparable
Key.VALUE_SHORT Comparable
Key.VALUE_INTEGER Comparable
Key.VALUE_LONG Comparable
Key.VALUE_BOOLEAN false < true
Key.VALUE_FLOAT Comparable
Key.VALUE_DOUBLE Comparable
Key.VALUE_BINARY IllegalArgumentException
Key.VALUE_DATE Comparable
Key.VALUE_ITEM IllegalArgumentException
Key.VALUE_ENUMELEMENT Comparable
Key.VALUE_UNKNOWN Comparable or IllegalArgumentException if unknown objects do not implement Comparable
Key.VALUE_SERIALIZABLE Comparable or IllegalArgumentException if serialized objects do not implement Comparable


Constructor Summary
ItemComparator(SortProperty[] sortProps)
          Constructor.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 boolean equals(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemComparator


public ItemComparator(SortProperty[] sortProps)
Constructor.
Parameters:
sortProps - the sort properties (not null). Properties earlier in the array have higher sort priority.
Method Detail

compare


public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator
See Also:
(Object, Object)

equals


public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.