Package org.gvsig.utils
Class CompareLists
java.lang.Object
org.gvsig.utils.CompareLists
This class has methods to compare lists of objects
- Author:
- Pablo Piqueras Bartolomé (p_queras@hotmail.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCompares two lists of elements, using the value returned of the toString() method of each element.static booleancompare(List l1, List l2, Comparator comp) Compares two lists of elements, using the value returned of the toString() method of each element.static booleancompareIgnoringCaseSensitive(List l1, List l2) Compares two lists of elements, using the value returned of the toString() method of each element.static booleancompareIgnoringCaseSensitive(List l1, List l2, Comparator comp) Compares two lists of elements, using the value returned of the toString() method of each element.
-
Constructor Details
-
CompareLists
public CompareLists()
-
-
Method Details
-
compare
Compares two lists of elements, using the value returned of the toString() method of each element.
Each element must also implement theComparableinterface.
This method considers case sensitive .- Parameters:
l1- First list of items. @see java.util.Listl2- Second list of items. @see java.util.List- Returns:
- True if the two lists have the same number of elements, and elements are in the same position of the two lists and have the same String value .
-
compareIgnoringCaseSensitive
Compares two lists of elements, using the value returned of the toString() method of each element.
Each element must also implement theComparableinterface.
This method ignores case sensitive during the comparation.- Parameters:
l1- First list of items. @see java.util.Listl2- Second list of items. @see java.util.List- Returns:
- True if the two lists have the same number of elements, and elements are in the same position of the two lists and have the same String value .
-
compare
Compares two lists of elements, using the value returned of the toString() method of each element.
Each element must also implement theComparableinterface.- Parameters:
l1- First list of items. @see java.util.Listl2- Second list of items. @see java.util.Listcomp- A class which implements the compare method of the Comparator interface .- Returns:
- True if the two lists have the same number of elements, and elements are in the same position of the two lists and have the same String value .
-
compareIgnoringCaseSensitive
Compares two lists of elements, using the value returned of the toString() method of each element.
Each element must also implement theComparableinterface.
This method ignores case sensitive during the comparation.- Parameters:
l1- First list of items. @see java.util.Listl2- Second list of items. @see java.util.Listcomp- A class which implements the compare method of the Comparator interface .- Returns:
- True if the two lists have the same number of elements, and elements are in the same position of the two lists and have the same String value .
-