|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compoze.collab.ItemComparator
public class ItemComparator
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
| Collator
|
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 (default Collator ). |
|
ItemComparator(SortProperty[] sortProps,
Collator collator)
Constructor. |
Method Summary | |
---|---|
int |
compare(Object o1,
Object o2)
|
boolean |
equals(Object obj)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ItemComparator(SortProperty[] sortProps)
Collator
).
sortProps
- the sort properties (not null
).
Properties earlier in the array have higher sort priority.public ItemComparator(SortProperty[] sortProps, Collator collator)
sortProps
- the sort properties (not null
).
Properties earlier in the array have higher sort priority.collator
- the collator for comparing
String
values (null
for default
Collator
)Method Detail |
---|
public int compare(Object o1, Object o2)
compare
in interface Comparator
(Object, Object)
public boolean equals(Object obj)
equals
in interface Comparator
equals
in class Object
Object.equals(java.lang.Object)
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |