- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
String townName = (params.get("town") == null ? "" : params.get("town").toLowerCase());
List<String> towns = new LinkedList();
int i = 0;
for (Town town : service.getTowns()) {
if (townName.length() > 0) {
if (town.getName().toLowerCase().startsWith(townName)) {
towns.add(town.getName());
i++;
}
} else {
towns.add(town.getName());
i++;
}
if (i == 10) {
break;
}
}