Package overit.geocall.sql
Class DBRowComparator
java.lang.Object
overit.geocall.sql.DBRowComparator
- All Implemented Interfaces:
Serializable,Comparator
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected DBView[]protected Mapprotected intprotected int[]protected Stringprotected int[]protected StaticView[]protected int[] -
Constructor Summary
ConstructorsConstructorDescriptionDBRowComparator(String ordermode) Creates a new DBRowComparatorDBRowComparator(String ordermode, Identified caller) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinal intprotected intbooleanReturnstrueif the DBRowComparator is working in inverse modestatic StringreverseMode(String order) Returns the reverse order from the one passed as a parametervoidsetAllDifferents(boolean b) Defines whether the comparator considers also different rows that have the same values on the fields of interestvoidsetInverse(boolean inverse) Sets the working mode of the DBRowComparatorvoidsetupMetaData(Map m) Setup of the map of the fields that compose the rowsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
_ordermode
-
_positions
protected int[] _positions -
_inverses
protected int[] _inverses -
_sv
-
_dbvSv
-
_svColumnPos
protected int[] _svColumnPos -
_inverse
protected int _inverse -
_fieldmap
-
_allDifferents
protected boolean _allDifferents
-
-
Constructor Details
-
DBRowComparator
Creates a new DBRowComparator- Parameters:
ordermode- A string that defines the name of a single field of the row to create a row comparator based on that field; it can be the name of a single field preceded by the exclamation mark, to obtain a row comparator that can order the values in descending order. It can also be a comma separated list of field names (with or without exclamation marks) to obtain a comparator based on multiple fields. The null value is allowed.
-
DBRowComparator
Deprecated.useDBRowComparator(String)instead- Parameters:
ordermode- A string that defines the name of a single field of the row to create a row comparator based on that field; it can be the name of a single field preceded by the exclamation mark, to obtain a row comparator that can order the values in descending order. It can also be a comma separated list of field names (with or without exclamation marks) to obtain a comparator based on multiple fields. The null value is allowed.caller- TheIdentified
-
-
Method Details
-
setAllDifferents
public void setAllDifferents(boolean b) Defines whether the comparator considers also different rows that have the same values on the fields of interest- Parameters:
b-trueto consider the rows different,falseotherwise
-
setupMetaData
Setup of the map of the fields that compose the rows- Parameters:
m- The map of the fields of the rows to compare
-
compare
- Specified by:
comparein interfaceComparator
-
calcPositions
protected void calcPositions() -
compare
-
getInverse
public boolean getInverse()Returnstrueif the DBRowComparator is working in inverse mode- Returns:
trueif the comparator is working in inverse mode,falseotherwise
-
setInverse
public void setInverse(boolean inverse) Sets the working mode of the DBRowComparator- Parameters:
inverse-trueto make it working in inverse mode,falseotherwise
-
reverseMode
Returns the reverse order from the one passed as a parameter- Parameters:
order- The string that defines an order for the comparator. It can be the name of a single field, the name of a single field preceded by the exclamation mark or a comma separated list of field names (with or without exclamation marks)- Returns:
- The string that defines the reverse order
-
DBRowComparator(String)instead