Subversion Repositories eFlore/Applications.cel

Rev

Rev 2668 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2668 Rev 2693
Line 178... Line 178...
178
		
178
		
179
		return dep;
179
		return dep;
Line 180... Line 180...
180
	}
180
	}
181
	
181
	
182
	public static String supprimerChaineIdLocalite(String chaineLocaliteComplete) {
182
	public static String supprimerChaineIdLocalite(String chaineLocaliteComplete) {
Line 183... Line 183...
183
		return chaineLocaliteComplete.replaceAll(" \\([a-zA-Z0-9]*\\)", "");
183
		return chaineLocaliteComplete.replaceAll(" \\([a-zA-Z0-9]*\\)", "").trim();
184
	}
184
	}
185
	
185
	
Line 295... Line 295...
295
			return false;  
295
			return false;  
296
		}  
296
		}  
297
		return true;  
297
		return true;  
298
	}
298
	}
Line -... Line 299...
-
 
299
	
-
 
300
	public static boolean estLaCorse(String s) {
-
 
301
		// Les générations futures d'informaticiens me jugeront
-
 
302
		// (et éventuellement géreront mieux le cas de la Corse que je ne l'ai fait)
-
 
303
		return s.toUpperCase().equals("2A") || s.toUpperCase().equals("2B");
-
 
304
	}
-
 
305
	
-
 
306
	public static boolean estUnDepartement(String s) {
-
 
307
		return estUnNombre(s) || estLaCorse(s);
-
 
308
	}
299
	
309
	
300
	public static String formaterNombre(String s) {
310
	public static String formaterNombre(String s) {
301
		s = s.indexOf(".") < 0 ? s : s.replaceAll("0*$", "").replaceAll("\\.$", "");
311
		s = s.indexOf(".") < 0 ? s : s.replaceAll("0*$", "").replaceAll("\\.$", "");
302
		return s;
312
		return s;
Line 412... Line 422...
412
		}
422
		}
413
		return chaineChaMot;
423
		return chaineChaMot;
414
	}
424
	}
Line 415... Line 425...
415
 
425
 
-
 
426
	protected static String convertirMotEnChaMot(String s) {
416
	protected static String convertirMotEnChaMot(String s) {
427
		// MiaOu
417
		return s.substring(0, 1).toUpperCase() +
428
		return s.substring(0, 1).toUpperCase() +
418
	               s.substring(1).toLowerCase();
429
	               s.substring(1).toLowerCase();
Line 419... Line 430...
419
	}
430
	}
Line 504... Line 515...
504
			
515
			
505
			for (int i = 0; i < taillemax; i++) {
516
			for (int i = 0; i < taillemax; i++) {
506
				if ((localites = reponse.get(i).isArray()) != null) {
517
				if ((localites = reponse.get(i).isArray()) != null) {
507
					String localite = ((JSONString) localites.get(0)).stringValue();
518
					String localite = ((JSONString) localites.get(0)).stringValue();
508
					String codeLocalite  = ((JSONString) localites.get(1)).stringValue();
519
					String codeLocalite  = ((JSONString) localites.get(1)).stringValue();
509
					ReferentielLocalite com = new ReferentielLocalite(localite, codeLocalite);		
520
					ReferentielLocalite com = new ReferentielLocalite(localite, codeLocalite);
510
					referentielLocaliteData.put(com.getLocalite() + com.getCodeLocalite(), com);			
521
					referentielLocaliteData.put(com.getLocalite(), com);			
511
				}	
522
				}	
512
			}
523
			}
513
		} else {					
524
		} else {					
514
			referentielLocaliteData = new HashMap<String, ReferentielLocalite>(0);
525
			referentielLocaliteData = new HashMap<String, ReferentielLocalite>(0);