- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
private boolean get(CharArrayExt szNum, CountryAreaContainer container) {
char cCur = 0;
if(!szNum.isEmpty()) {
cCur = szNum.charAt(0);
}
Country lpSettingsCountry = isRemoveNPrefixAfterCC();
if ((cCur != 0) && lpSettingsCountry != null) {
int iLen = lpSettingsCountry.getNationalPrefix().length();
if ((iLen > 0) && szNum.startsWith(lpSettingsCountry.getNationalPrefix())) {
szNum.cut(iLen);
cCur = szNum.charAt(0);
container.areaOffset = iLen;
}
}
if ((cCur != 0) && isNodeExist(cCur)) {
if(getNode(cCur).get(szNum.cut(1), container)) {
return true;
}
}
int iCount = items.size();
if (iCount == 1) { //Normally
NodeItemBase lpItem = items.get(0);
if (lpItem.isArea()) {
container.area = (Area) lpItem;
}
container.country = lpItem.getCountry();
return true;
} else {
if (iCount > 1) {
for (int i = 0; i < iCount; i++) {
NodeItemBase lpItem = items.get(i);
if (lpItem.isCountry()) {
Country lpCountry = (Country) lpItem;
if (lpCountry.getAreas().size() == 0) {
container.country = lpCountry;
return true;
}
}
}
}
}
return false;
}