public class BinarySearch extends java.lang.Object implements ILookUp
JComboBoxConfigurableLookUp
Constructor and Description |
---|
BinarySearch() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Object> |
doLookUpConsideringCaseSensitive(java.lang.String text,
java.util.Vector<java.lang.Object> sortOrderedItems,
StringComparator comp)
This method should be used when is wanted to distinguish small letters from capital letters during the search.
|
java.util.List<java.lang.Object> |
doLookUpIgnoringCaseSensitive(java.lang.String text,
java.util.Vector<java.lang.Object> sortOrderedItems,
StringComparator comp)
This method should be used when is wanted not to distinguish small letters from capital letters during the search, and the comparison of items
done according an algorithm we define.
|
public java.util.List<java.lang.Object> doLookUpConsideringCaseSensitive(java.lang.String text, java.util.Vector<java.lang.Object> sortOrderedItems, StringComparator comp)
ILookUp
This method should be used when is wanted to distinguish small letters from capital letters during the search.
It's necessary that all items of the array implement the Comparable
interface.
It's also necessary that the value returned by the toString() method of each item (supposing they inherit from Object) would be the expected value user saw (that would be used to compare the items).
And elements of the Vector
should be sort ordered by a StringComparator
with the same configuration as comp
.
doLookUpConsideringCaseSensitive
in interface ILookUp
text
- java.lang.StringsortOrderedItems
- java.util.Vectorcomp
- An StringComparator
object which implements the compareTo() method. Must have the same configuration that was
used to sort order the items of sortOrderedItems
.public java.util.List<java.lang.Object> doLookUpIgnoringCaseSensitive(java.lang.String text, java.util.Vector<java.lang.Object> sortOrderedItems, StringComparator comp)
ILookUp
This method should be used when is wanted not to distinguish small letters from capital letters during the search, and the comparison of items done according an algorithm we define.
It's necessary that all items of the array implement the Comparable
interface.
It's also necessary that the value returned by the toString() method of each item (supposing they inherit from Object) would be the expected value user saw (that would be used to compare the items).
And elements of the Vector
should be sort ordered by a StringComparator
with the same configuration as comp
.
doLookUpIgnoringCaseSensitive
in interface ILookUp
text
- java.lang.StringsortOrderedItems
- java.util.Vectorcomp
- An StringComparator
object which implements the compareTo() method. Must have the same configuration that was
used to sort order the items of sortOrderedItems
.