Revision 11586

View differences:

trunk/libraries/libUI/src/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/BinarySearchUsingFirstCharacters.java
1
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker;
2

  
3
import java.util.ArrayList;
4
import java.util.Arrays;
5
import java.util.Comparator;
6
import java.util.List;
7
import java.util.Vector;
8

  
9

  
10
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
11
 *
12
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
13
 *
14
 * This program is free software; you can redistribute it and/or
15
 * modify it under the terms of the GNU General Public License
16
 * as published by the Free Software Foundation; either version 2
17
 * of the License, or (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU General Public License
25
 * along with this program; if not, write to the Free Software
26
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
27
 *
28
 * For more information, contact:
29
 *
30
 *  Generalitat Valenciana
31
 *   Conselleria d'Infraestructures i Transport
32
 *   Av. Blasco Ib??ez, 50
33
 *   46010 VALENCIA
34
 *   SPAIN
35
 *
36
 *      +34 963862235
37
 *   gvsig@gva.es
38
 *      www.gvsig.gva.es
39
 *
40
 *    or
41
 *
42
 *   IVER T.I. S.A
43
 *   Salamanca 50
44
 *   46005 Valencia
45
 *   Spain
46
 *
47
 *   +34 963163400
48
 *   dac@iver.es
49
 */
50

  
51
/**
52
 * This class has static methods that return items that their beginning text value matches with a text pattern. <br>
53
 * It's necessary that items of the parameter array (Vector) were sort ordered according to their text value. <br>
54
 * Supports Vectors with and without repeated items.
55
 * 
56
 * There are four methods, that are a modification of a binary search algorithm of search, getting a rank of items:
57
 * <ul>
58
 * <li>Considering case sensitive in the search.</li>
59
 * <li>Ignoring case sensitive in the search.</li>
60
 * <li>Considering case sensitive in the search and an object which implements the Comparable interface</li>
61
 * <li>Ignoring case sensitive in the search, but yes an objecth which implements the Comparable interface</li>
62
 * </ul>
63
 * 
64
 * This class is a copy of a class with the same name located in <i>libIverUtiles</i>
65
 * 
66
 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
67
 */
68
public class BinarySearchUsingFirstCharacters {
69
	/**
70
	 * This method should be used when is wanted to distinguish small letters from capital letters during the search.
71
	 *   
72
	 * It's necessary that all items of the array implement the {@link Comparable} interface.<br>
73
	 * And it's also necessary that the value returned by the <i>toString()</i> method of each item (supposing 
74
	 *   they inherit from Object) would be the expected value user saw (that would be used to compare the items).
75
	 *   
76
	 * @param text java.lang.String
77
	 * @param sortOrderedItems java.util.Vector
78
	 */
79
	public synchronized static List doSearchConsideringCaseSensitive(String text, Vector sortOrderedItems) {
80
		int currentIteration = 0;
81
		int size = sortOrderedItems.size();
82
		int maxNumberOfIterations = (int) MathExtensionReduced.log2(size);
83
		int lowIndex = 0;
84
		int highIndex = sortOrderedItems.size() - 1;
85
		int mIndx;
86
		
87
		while ((lowIndex <= highIndex) && (currentIteration <= maxNumberOfIterations)) {
88
			mIndx = ( lowIndex + highIndex ) / 2;
89
			
90
			if ( sortOrderedItems.get( mIndx ).toString().startsWith( text ) ) {
91
				lowIndex = highIndex = mIndx;
92
				highIndex ++;
93
				
94
				// Expand the rank to up
95
				while ( ( highIndex < size ) && ( sortOrderedItems.get( highIndex ).toString().startsWith( text ) ) ) {
96
					highIndex ++;
97
				}
98

  
99
				// Expand the rank to down
100
				while ( ( (lowIndex - 1) > -1 ) && ( sortOrderedItems.get( (lowIndex - 1) ).toString().startsWith( text ) ) ) {
101
					lowIndex --;
102
				}
103

  
104
				// It's possible that items with different case, should be between the same case, then this item will be added individually:
105
				List list = new Vector(sortOrderedItems.subList(lowIndex, highIndex));
106
				
107
				// Expand to down
108
				lowIndex --;
109
				while ( ( lowIndex > -1 ) && ( sortOrderedItems.get( (lowIndex ) ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
110
					if (sortOrderedItems.get( lowIndex ).toString().startsWith( text )) {
111
						list.add(0, sortOrderedItems.get( lowIndex ));
112
					}
113
					
114
					lowIndex --;
115
				}
116
				
117
				// Expand to up
118
				while ( ( highIndex < size ) && ( sortOrderedItems.get( highIndex ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
119
					if (sortOrderedItems.get( highIndex ).toString().startsWith( text )) {						
120
						list.add(list.size(), sortOrderedItems.get( highIndex ));
121
					}
122
					
123
					highIndex ++;
124
				}
125
				
126
				// Returns all items in the rank
127
				return list; // Breaks the loop
128
			}
129
			else {
130
				if ( sortOrderedItems.get( mIndx ).toString().compareTo( text ) > 0 ) {
131
					highIndex = mIndx - 1;
132
				}
133
				else {
134
					lowIndex = mIndx + 1;
135
				}
136
			}
137
			
138
			currentIteration ++;
139
		}
140
		
141
		// If no item has been found -> return null
142
		return null;
143
	}
144
	
145
	/**
146
	 * This method should be used when is wanted not to distinguish small letters from capital letters during the search.
147
	 *   
148
	 * It's necessary that all items of the array implement the {@link Comparable} interface.<br>
149
	 * And it's also necessary that the value returned by the <i>toString()</i> method of each item (supposing 
150
	 *   they inherit from Object) would be the expected value user saw (that would be used to compare the items).
151
	 *
152
	 * In this particular situation, it's supposed that the vector is sort ordered according the default algorithm of Java; this has the problem that
153
	 *   it doesn't consideres the special characters and the orthographic rules of languages that aren't English, and then, for a particular
154
	 *   <i>text</i> search, an incorrect result could be obtained. The solution decided for this problem has been to modify the algorithm, for seach
155
	 *   into two ranks.
156
	 *
157
	 * @param text java.lang.String
158
	 * @param sortOrderedItems java.util.Vector
159
	 */
160
	public synchronized static List doSearchIgnoringCaseSensitive(String text, Vector sortOrderedItems) {
161
		int currentIteration = 0;
162
		int size = sortOrderedItems.size();
163
		int maxNumberOfIterations = (int) MathExtensionReduced.log2(size);
164
		int lowIndex = 0;
165
		int highIndex = sortOrderedItems.size() - 1;
166
		int mIndx;
167
		List list = null;
168
		List list2 = null;
169

  
170
		// FIRST RANK
171
		while ((lowIndex <= highIndex) && (currentIteration <= maxNumberOfIterations)) {
172
			mIndx = ( lowIndex + highIndex ) / 2;
173
			
174
			if ( sortOrderedItems.get( mIndx ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) {
175
				lowIndex = highIndex = mIndx;
176
				highIndex ++;
177
				
178
				// Expand the rank to up
179
				while ( ( highIndex < size ) && ( sortOrderedItems.get( highIndex ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
180
					highIndex ++;
181
				}
182

  
183
				// Expand the rank to down
184
				while ( ( (lowIndex - 1) > -1 ) && ( sortOrderedItems.get( (lowIndex - 1) ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
185
					lowIndex --;
186
				}
187
				
188
				// Returns all items in the rank
189
				list = Arrays.asList((sortOrderedItems.subList(lowIndex, highIndex)).toArray());
190
				
191
//				list = new ArrayList(Arrays.asList((sortOrderedItems.subList(lowIndex, highIndex)).toArray())); // Breaks the loop
192
//				break;
193
			}
194
			else {
195
				if ( sortOrderedItems.get( mIndx ).toString().compareTo( text ) > 0 ) {
196
					highIndex = mIndx - 1;
197
				}
198
				else {
199
					lowIndex = mIndx + 1;
200
				}
201
			}
202
			
203
			currentIteration ++;
204
		}
205

  
206
		// SECOND RANK
207
		currentIteration = 0;
208
		lowIndex = 0;
209
		highIndex = sortOrderedItems.size() - 1;
210

  
211
		while ((lowIndex <= highIndex) && (currentIteration <= maxNumberOfIterations)) {
212
			mIndx = ( lowIndex + highIndex ) / 2;
213
			
214
			if ( sortOrderedItems.get( mIndx ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) {
215
				lowIndex = highIndex = mIndx;
216
				highIndex ++;
217
				
218
				// Expand the rank to up
219
				while ( ( highIndex < size ) && ( sortOrderedItems.get( highIndex ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
220
					highIndex ++;
221
				}
222

  
223
				// Expand the rank to down
224
				while ( ( (lowIndex - 1) > -1 ) && ( sortOrderedItems.get( (lowIndex - 1) ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
225
					lowIndex --;
226
				}
227
				
228
				// Returns all items in the rank			
229
				list2 = Arrays.asList((sortOrderedItems.subList(lowIndex, highIndex)).toArray()); // Breaks the loop
230
				
231
				if (list == null)
232
					return list2;
233
				else {
234
					if (list2 == null)
235
						return null;
236

  
237
					Object obj;
238
					int j;
239
					
240
					list = new ArrayList(list.subList(0, list.size()));
241
					
242
					for (int i = 0; i < list2.size(); i ++) {
243
						obj = list2.get(i);
244
					
245
						// Don't add items which are already in the list
246
						if (!list.contains(obj)) {
247
							// Adds in sort order the new item:
248
							for (j = 0; j < list.size(); j ++) {
249
								if (list.get(j).toString().compareTo(obj.toString()) > 0)
250
									break;
251
							}
252
							
253
							list.add(j, obj);
254
							System.out.println("A?ade: " + obj);
255
						}
256
					}
257
					
258
					return list;
259
				}
260
			}
261
			else {
262
				if ( sortOrderedItems.get( mIndx ).toString().toLowerCase().compareTo( text.toLowerCase() ) > 0 ) {
263
					highIndex = mIndx - 1;
264
				}
265
				else {
266
					lowIndex = mIndx + 1;
267
				}
268
			}
269
			
270
			currentIteration ++;
271
		}
272
		
273
		return null;
274
	}
275
	
276
	/**
277
	 * This method should be used when is wanted distinguish small letters from capital letters during the search, and the comparation of items
278
	 *   done according an algorithm we define.
279
	 *   
280
	 * And it's also necessary that the value returned by the <i>toString()</i> method of each item (supposing 
281
	 *   they inherit from Object) would be the expected value user saw (that would be used to compare the items).
282
	 *   
283
	 * @param text java.lang.String
284
	 * @param sortOrderedItems java.util.Vector
285
	 * @param comp An Comparator object which implements the <i><b>compareTo()</b><i>  method.
286
	 */
287
	public synchronized static List doSearchConsideringCaseSensitive(String text, Vector sortOrderedItems, Comparator comp) {
288
		int currentIteration = 0;
289
		int size = sortOrderedItems.size();
290
		int maxNumberOfIterations = (int) MathExtensionReduced.log2(size);
291
		int lowIndex = 0;
292
		int highIndex = sortOrderedItems.size() - 1;
293
		int mIndx;
294

  
295

  
296
		while ((lowIndex <= highIndex) && (currentIteration <= maxNumberOfIterations)) {
297
			mIndx = ( lowIndex + highIndex ) / 2;
298

  
299
			if ( sortOrderedItems.get( mIndx ).toString().startsWith( text ) ) {
300
				lowIndex = highIndex = mIndx;
301
				highIndex ++;
302

  
303
				// Expand the rank to up
304
				while ( ( highIndex < size ) && ( sortOrderedItems.get( highIndex ).toString().startsWith( text ) ) ) {
305
					highIndex ++;
306
				}
307

  
308
				// Expand the rank to down
309
				while ( ( (lowIndex - 1) > -1 ) && ( sortOrderedItems.get( (lowIndex - 1) ).toString().startsWith( text ) ) ) {
310
					lowIndex --;
311
				}
312

  
313
				// It's possible that items with different case, should be between the same case, then this item will be added individually:
314
				List list = new Vector(sortOrderedItems.subList(lowIndex, highIndex));
315
				
316

  
317
				// Expand to down
318
				lowIndex --;
319
				while ( ( lowIndex > -1 ) && ( sortOrderedItems.get( (lowIndex ) ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
320
					if (sortOrderedItems.get( lowIndex ).toString().startsWith( text )) {
321
						list.add(0, sortOrderedItems.get( lowIndex ));
322
					}
323
					
324
					lowIndex --;
325
				}
326
				
327
				// Expand to up
328
				while ( ( highIndex < size ) && ( sortOrderedItems.get( highIndex ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
329
					if (sortOrderedItems.get( highIndex ).toString().startsWith( text )) {						
330
						list.add(list.size(), sortOrderedItems.get( highIndex ));
331
					}
332
					
333
					highIndex ++;
334
				}
335
				
336
				// Returns all items in the rank
337
				return list; // Breaks the loop
338
			}
339
			else {
340
				if ( comp.compare(sortOrderedItems.get( mIndx ), text ) > 0 ) {
341
					highIndex = mIndx - 1;
342
				}
343
				else {
344
					lowIndex = mIndx + 1;
345
				}
346
			}
347

  
348
			currentIteration ++;
349
		}
350

  
351
		// If no item has been found -> return null
352
		return null;
353
	}
354
	
355
	/**
356
	 * This method should be used when is wanted not to distinguish small letters from capital letters during the search, and the comparation of items
357
	 *   done according an algorithm we define.
358
	 *   
359
	 * And it's also necessary that the value returned by the <i>toString()</i> method of each item (supposing 
360
	 *   they inherit from Object) would be the expected value user saw (that would be used to compare the items).
361
	 *
362
	 * @param text java.lang.String
363
	 * @param sortOrderedItems java.util.Vector
364
	 * @param comp An Comparator object which implements the <i><b>compareTo()</b><i>  method.
365
	 */
366
	public synchronized static List doSearchIgnoringCaseSensitive(String text, Vector sortOrderedItems, Comparator comp) {
367
		int currentIteration = 0;
368
		int size = sortOrderedItems.size();
369
		int maxNumberOfIterations = (int) MathExtensionReduced.log2(size);
370
		int lowIndex = 0;
371
		int highIndex = sortOrderedItems.size() - 1;
372
		int mIndx;
373
		
374
		while ((lowIndex <= highIndex) && (currentIteration <= maxNumberOfIterations)) {
375
			mIndx = ( lowIndex + highIndex ) / 2;
376
			
377
			if ( sortOrderedItems.get( mIndx ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) {
378
				lowIndex = highIndex = mIndx;
379
				highIndex ++;
380
				
381
				// Expand the rank to up
382
				while ( ( highIndex < size ) && ( sortOrderedItems.get( highIndex ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
383
					highIndex ++;
384
				}
385

  
386
				// Expand the rank to down
387
				while ( ( (lowIndex - 1) > -1 ) && ( sortOrderedItems.get( (lowIndex - 1) ).toString().toLowerCase().startsWith( text.toLowerCase() ) ) ) {
388
					lowIndex --;
389
				}
390
				
391
				// Returns all items in the rank			
392
				return Arrays.asList((sortOrderedItems.subList(lowIndex, highIndex)).toArray()); // Breaks the loop
393
			}
394
			else {
395
				if ( comp.compare(sortOrderedItems.get( mIndx ).toString().toLowerCase(), text.toLowerCase() ) > 0 ) {
396
					highIndex = mIndx - 1;
397
				}
398
				else {
399
					lowIndex = mIndx + 1;
400
				}
401
			}
402
			
403
			currentIteration ++;
404
		}
405
		
406
		return null;
407
	}
408
}
0 409

  
trunk/libraries/libUI/src/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/ISearchUsingFirstCharacters.java
1
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker;
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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 2
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42

  
43
/**
44
 * Interface for all the Models which will allow search items using first characters
45
 * 
46
 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
47
 */
48
public interface ISearchUsingFirstCharacters {
49
	/**
50
	 * Sets a text for search items
51
	 */
52
	public void setTextWritten(String text);
53
}
0 54

  
trunk/libraries/libUI/src/org/gvsig/gui/beans/swing/jComboBoxItemsSeeker/StringComparator.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package org.gvsig.gui.beans.swing.jComboBoxItemsSeeker;
42

  
43
import java.text.Collator;
44
import java.util.Comparator;
45

  
46
/**
47
 * Compares two chain of characters alphabetically
48
 *
49
 * This class is a copy of a class with the same name located in <i>libIverUtiles</i>
50
 * 
51
 * @author Fernando Gonz?lez Cort?s
52
 * @author Pablo Piqueras Bartolom?
53
 */
54
public class StringComparator implements Comparator {
55
	private boolean caseSensitive = true;
56
	private LocaleRules localeRules = null;
57

  
58
    /**
59
     * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
60
     */
61
    public int compare(Object o1, Object o2) {
62
        String s1 = (String) o1;
63
        String s2 = (String) o2;
64

  
65
        // If localeRules is null -> use the default rules
66
        if (localeRules == null) {
67
        	if (caseSensitive) {
68
        		return s1.compareTo(s2);
69
        	}
70
        	else {
71
        		return s1.compareToIgnoreCase(s2);
72
        	}
73
        }
74
        else {
75
        	if (localeRules.isUseLocaleRules()) {
76
        		Collator collator = localeRules.getCollator();
77
        		
78
        		if (caseSensitive) {
79
        			return collator.compare(s1, s2);
80
        		}
81
        		else {
82
        			return collator.compare(s1.toLowerCase(), s2.toLowerCase());
83
        		}
84
        	}
85
        	else {
86
            	if (caseSensitive) {
87
            		return s1.compareTo(s2);
88
            	}
89
            	else {
90
            		return s1.compareToIgnoreCase(s2);
91
            	}
92
        	}
93
        }
94
    }
95

  
96
    /**
97
     * Returns if the comparator is sensitive to small and big letters
98
     *
99
     * @return
100
     */
101
    public boolean isCaseSensitive() {
102
        return caseSensitive;
103
    }
104

  
105
    /**
106
     * Establece la sensibilidad del comparador a las mayusculas y minusculas
107
     *
108
     * @param b
109
     */
110
    public void setCaseSensitive(boolean b) {
111
        caseSensitive = b;
112
    }
113
    
114
    /**
115
     * Gets an object with the information for use the locale rules in comparation between strings. <br>
116
     * <ul>
117
     * <li>A boolean value -> if want or not use the locale rules</li>
118
     * <li>A reference to the locale rules</li>
119
     * </ul>
120
     * 
121
     * @return @see LocaleRules
122
     */
123
    public LocaleRules getLocaleRules() {
124
    	return localeRules;
125
    }    
126
    /**
127
     * Sets an object with the information for use the locale rules in comparation between strings. <br>
128
     * <ul>
129
     * <li>A boolean value -> if want or not use the locale rules</li>
130
     * <li>A reference to the locale rules</li>
131
     * </ul>
132
     * 
133
     * @param @see LocaleRules
134
     */
135
    public void setLocaleRules(LocaleRules locRules) {
136
    	localeRules = locRules;
137
    }
138
    
139
    /**
140
     * Represents the information needed by <i>StringComparator</i> for use or not locale-sensitive String comparison-rules in the <b><i>compare</i></b> method
141
     * 
142
     * @author Pablo Piqueras Bartolom?
143
     */
144
    public class LocaleRules {
145
    	 private boolean useLocaleRules;
146
    	 private Collator _collator;
147
    	 
148
    	 /**
149
    	  * Default constructor without parameters
150
    	  */
151
    	 public LocaleRules() {
152
    		 useLocaleRules = false;
153
    		 _collator = null;
154
    	 }
155
    	 
156
    	 /**
157
    	  * Default constructor with two parameters
158
    	  * 
159
    	  * @param b Use locale rules
160
    	  * @param collator A reference to an object configurated for locale-sensitive String comparison
161
    	  */
162
    	 public LocaleRules(boolean b, Collator collator) {
163
    		 useLocaleRules = b;
164
    		 _collator = collator;
165
    	 }
166
    	 
167
 		/**
168
 		 * Gets the value of the inner attribute <i>_collator</i>
169
 		 * 
170
 		 * @return Returns A reference to an object configurated for locale-sensitive String comparison
171
 		 */
172
 		public Collator getCollator() {
173
 			return _collator;
174
 		}
175

  
176
 		/**
177
 		 * Sets a value to the inner attribute <i>_collator</i>
178
 		 * 
179
 		 * @param collator A reference to an object configurated for locale-sensitive String comparison
180
 		 */
181
 		public void setCollator(Collator collator) {
182
 			this._collator = collator;
183
 		}
184

  
185
		/**
186
		 * Gets the value of the inner attribute <i>useLocaleRules</i>
187
		 * 
188
		 * @return Returns the useLocaleRules.
189
		 */
190
		public boolean isUseLocaleRules() {
191
			return useLocaleRules;
192
		}
193

  
194
		/**
195
		 * Sets a value to the inner attribute <i>useLocaleRules</i>
196
		 * 
197
		 * @param useLocaleRules The useLocaleRules to set.
198
		 */
199
		public void setUseLocaleRules(boolean useLocaleRules) {
200
			this.useLocaleRules = useLocaleRules;
201
		}
202
    }
203
}
0 204

  

Also available in: Unified diff