Package com.storedobject.common
Class PKAddress
java.lang.Object
com.storedobject.common.Address
com.storedobject.common.PKAddress
IN Address
line[0]: Place name within the district
line[1]: District code
line[2]: Province code
line[0]: Place name within the district
line[1]: District code
line[2]: Province code
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionintRetrieves the district identifier from the address data.Retrieves the name of the district from the address data.static String[]getDistricts(int state) Retrieves the list of districts for a specified state.intGet the number of extra lines.Retrieves the name of the place from the address data.intWhat is the maximum length of the postal code?intRetrieves the province identifier from the address data.Retrieves the name of the province from the address data.static String[]Retrieves the list of provinces available in the address data.booleanIs postal code mandatory?voidsetDistrict(int district) Sets the district identifier in the address data.voidsetPlaceName(String placeName) Sets the name of the place in the address data.voidsetProvince(int province) Sets the province identifier in the address data.Methods inherited from class com.storedobject.common.Address
arrangeLines, check, check, copy, create, create, encode, getApartmentName, getAreaCaption, getAreaName, getBuildingName, getCountry, getHouseName, getLine, getOfficeName, getPOBox, getPOBoxName, getPostalCode, getPostalCodeCaption, getPostalCodeMinLength, getStreetName, getType, getTypeValue, getTypeValue, getTypeValues, getVillaName, isNumericPostalCode, isPOBoxAddress, isPostalCodeAddress, isValid, poBoxPrefix, poBoxSuffix, setApartmentName, setAreaName, setBuildingName, setHouseName, setLine, setOfficeName, setPOBox, setPostalCode, setStreetName, setType, setVillaName, toString, toString, validate
-
Method Details
-
getExtraLines
public int getExtraLines()Description copied from class:AddressGet the number of extra lines.- Overrides:
getExtraLinesin classAddress- Returns:
- Number of extra lines in the address.
-
getPlaceName
Retrieves the name of the place from the address data.- Returns:
- The name of the place extracted from the address lines.
-
setPlaceName
Sets the name of the place in the address data.- Parameters:
placeName- The name of the place to set. If null, it is replaced with an empty string.
-
getProvince
Retrieves the province identifier from the address data.- Returns:
- The province identifier extracted from the address lines.
- Throws:
SOException- If an error occurs while extracting the province information.
-
setProvince
public void setProvince(int province) Sets the province identifier in the address data.- Parameters:
province- The province identifier to set. The value is adjusted to ensure it falls within the valid range based on the number of provinces available.
-
getProvinceName
Retrieves the name of the province from the address data.- Returns:
- The name of the province extracted from the address lines.
-
getDistrict
Retrieves the district identifier from the address data.- Returns:
- The district identifier extracted from the address lines.
- Throws:
SOException- If an error occurs while extracting the district information.
-
setDistrict
public void setDistrict(int district) Sets the district identifier in the address data.- Parameters:
district- The district identifier to set. The value is adjusted to ensure it falls within the valid range of districts for the specified province.
-
getDistrictName
Retrieves the name of the district from the address data.- Returns:
- The name of the district extracted from the address lines.
- Throws:
SOException- If an error occurs while extracting the district information.
-
getProvinces
Retrieves the list of provinces available in the address data.- Returns:
- An array of strings containing the names of all provinces.
-
getDistricts
Retrieves the list of districts for a specified state.- Parameters:
state- The index of the state for which the districts are to be retrieved. The index corresponds to the position of the state in a predefined collection of states.- Returns:
- An array of strings containing the names of the districts for the specified state.
-
isPostalCodeMandatory
public boolean isPostalCodeMandatory()Description copied from class:AddressIs postal code mandatory?- Overrides:
isPostalCodeMandatoryin classAddress- Returns:
- True/false.
-
getPostalCodeMaxLength
public int getPostalCodeMaxLength()Description copied from class:AddressWhat is the maximum length of the postal code?- Overrides:
getPostalCodeMaxLengthin classAddress- Returns:
- Maximum required length of the postal code.
-