Package org.compiere.util
Class MSort
- java.lang.Object
-
- org.compiere.util.MSort
-
- All Implemented Interfaces:
Serializable
,Comparator<Object>
public final class MSort extends Object implements Comparator<Object>, Serializable
Class to Sort DataChange 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:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Object o1, Object o2)
Compare Data of two entitiesboolean
equals(Object obj)
Equal (based on data, ignores index)int
hashCode()
void
setSortAsc(boolean ascending)
Sort AscendingString
toString()
String Representation-
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 Detail
-
index
public int index
Direct access index
-
data
public Object data
The data
-
-
Constructor Detail
-
MSort
public MSort(int new_index, Object new_data)
Constructor - Sort Entity- Parameters:
new_index
- indexnew_data
- data
-
-
Method Detail
-
setSortAsc
public void setSortAsc(boolean ascending)
Sort Ascending- Parameters:
ascending
- if true sort ascending
-
compare
public int compare(Object o1, Object o2)
Compare Data of two entities- Specified by:
compare
in interfaceComparator<Object>
- Parameters:
o1
- objecto2
- object- Returns:
- comparator
-
equals
public boolean equals(Object obj)
Equal (based on data, ignores index)- Specified by:
equals
in interfaceComparator<Object>
- Overrides:
equals
in classObject
- Parameters:
obj
- object- Returns:
- true if equal
-
-