svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.ui / src / main / java / org / gvsig / gui / beans / comboboxconfigurablelookup / ILookUp.java @ 40561
History | View | Annotate | Download (3.97 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.gui.beans.comboboxconfigurablelookup; |
25 |
|
26 |
import java.util.List; |
27 |
import java.util.Vector; |
28 |
|
29 |
/**
|
30 |
* <p>Interface for implementing algorithms that get a sublist of items that match with a text written according
|
31 |
* an orthographical rules and particular search requirements.</p>
|
32 |
*
|
33 |
* <p>There are two possibilities, considering or ignoring case sensitive.</p>
|
34 |
*
|
35 |
* <p>The particular implementation will be useful to integrate customized algorithms as the <i>look up</i>
|
36 |
* logic in the {@link JComboBoxConfigurableLookUp JComboBoxConfigurableLookUp} model.</p>
|
37 |
*
|
38 |
* @version 07/02/2008
|
39 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
|
40 |
*/
|
41 |
public interface ILookUp { |
42 |
/**
|
43 |
* <p>This method should be used when is wanted to distinguish small letters from capital letters during the search.</p>
|
44 |
*
|
45 |
* <p>It's necessary that all items of the array implement the {@link Comparable} interface.</p>
|
46 |
*
|
47 |
* <p>It's also necessary that the value returned by the <i>toString()</i> method of each item (supposing
|
48 |
* they inherit from Object) would be the expected value user saw (that would be used to compare the items).</p>
|
49 |
*
|
50 |
* <p>And elements of the <code>Vector</code> should be sort ordered by a <code>StringComparator</code> with the same configuration as <code>comp</code>.</p>
|
51 |
*
|
52 |
* @param text java.lang.String
|
53 |
* @param sortOrderedItems java.util.Vector
|
54 |
* @param comp An <code>StringComparator</code> object which implements the <i><b>compareTo()</b><i> method. Must have the same configuration that was
|
55 |
* used to sort order the items of <code>sortOrderedItems</code>.
|
56 |
*
|
57 |
* @return A sublist with all items that carry out with the particular search algorithm requirements
|
58 |
*/
|
59 |
public List<Object> doLookUpConsideringCaseSensitive(String text, Vector<Object> sortOrderedItems, StringComparator comp); |
60 |
|
61 |
/**
|
62 |
* <p>This method should be used when is wanted not to distinguish small letters from capital letters during the search, and the comparison of items
|
63 |
* done according an algorithm we define.</p>
|
64 |
*
|
65 |
* <p>It's necessary that all items of the array implement the {@link Comparable} interface.</p>
|
66 |
*
|
67 |
* <p>It's also necessary that the value returned by the <i>toString()</i> method of each item (supposing
|
68 |
* they inherit from Object) would be the expected value user saw (that would be used to compare the items).</p>
|
69 |
*
|
70 |
* <p>And elements of the <code>Vector</code> should be sort ordered by a <code>StringComparator</code> with the same configuration as <code>comp</code>.</p>
|
71 |
*
|
72 |
* @param text java.lang.String
|
73 |
* @param sortOrderedItems java.util.Vector
|
74 |
* @param comp An <code>StringComparator</code> object which implements the <i><b>compareTo()</b><i> method. Must have the same configuration that was
|
75 |
* used to sort order the items of <code>sortOrderedItems</code>.
|
76 |
*
|
77 |
* @return A sublist with all items that carry out with the particular search algorithm requirements
|
78 |
*/
|
79 |
public List<Object> doLookUpIgnoringCaseSensitive(String text, Vector<Object> sortOrderedItems, StringComparator comp); |
80 |
} |