Package org.compiere.util
Class MSort
java.lang.Object
org.compiere.util.MSort
- All Implemented Interfaces:
Serializable
,Comparator<Object>
Class to Sort Data
Change log:
- 2007-01-27 - teo_sarca - [ 1585369 ] CTable sorting is TOO LAZY:
Fixed
compare(Object, Object)
method for Double comparing support, ascending/descending support, comparing strings ignoring case
- Version:
- $Id: MSort.java,v 1.3 2006/10/06 00:43:09 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
index
public int indexDirect access index -
data
The data
-
-
Constructor Details
-
MSort
Constructor - Sort Entity- Parameters:
new_index
- indexnew_data
- data
-
-
Method Details
-
setSortAsc
public void setSortAsc(boolean ascending) Sort Ascending- Parameters:
ascending
- if true sort ascending
-
compare
Compare o1 and o2- Specified by:
compare
in interfaceComparator<Object>
- Parameters:
o1
- objecto2
- object- Returns:
- -1 (less than), 0 (equal) or 1 (greater than). Reverse is return if sort descending.
-
equals
Equal (based ondata
, ignores index)- Specified by:
equals
in interfaceComparator<Object>
- Overrides:
equals
in classObject
- Parameters:
obj
- object- Returns:
- true if equal
-
hashCode
public int hashCode()Not implemented, always return 42 -
toString
String Representation
-