Package com.storedobject.common
Class INAddress
java.lang.Object
com.storedobject.common.Address
com.storedobject.common.INAddress
IN Address
line[0]: Post Office
line[1]: District code
line[2]: State code
line[0]: Post Office
line[1]: District code
line[2]: State code
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionprotected voidarrangeLines(ArrayList<String> lines) This method is invoked for arranging the address lines to be displayed.protected Stringconvert(int lineNumber) intRetrieves the district code associated with this address.Retrieves the name of the district associated with this address.static String[]getDistricts(int state) Retrieves the list of districts associated with the specified state.intGet the number of extra lines.Get the caption for the Postal Code.intWhat is the maximum length of the postal code?Retrieves the name of the post office associated with this address.intgetState()Retrieves the state code associated with this address.Retrieves the name of the state associated with this address.static String[]Retrieves the list of states associated with the address.booleanIs postal code mandatory?protected booleanparse()voidsetDistrict(int district) Sets the district code for this address.voidsetPostOfficeName(String name) Sets the name of the post office associated with this address.voidsetState(int state) Sets the state code for this address.Methods inherited from class com.storedobject.common.Address
check, check, copy, create, create, encode, getApartmentName, getAreaCaption, getAreaName, getBuildingName, getCountry, getHouseName, getLine, getOfficeName, getPOBox, getPOBoxName, getPostalCode, 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
-
parse
- Throws:
SOException
-
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.
-
convert
- Throws:
SOException
-
getPostOfficeName
Retrieves the name of the post office associated with this address.- Returns:
- The name of the post office as a String.
-
setPostOfficeName
Sets the name of the post office associated with this address.- Parameters:
name- The name of the post office to be set. If the value is null, it sets an empty string as the post office name.
-
getState
Retrieves the state code associated with this address.- Returns:
- The state code as an integer.
- Throws:
SOException- If an error occurs during the extraction process.
-
setState
public void setState(int state) Sets the state code for this address. The state index is calculated in a cyclic manner based on the total number of states. If an error occurs while retrieving the district, a default value of 0 is used.- Parameters:
state- The state code to be set. The value should be a non-negative integer. The method ensures its validity by taking the modulo with the total number of available states.
-
getStateName
Retrieves the name of the state associated with this address.- Returns:
- The name of the state as a String.
-
getDistrict
Retrieves the district code associated with this address.- Returns:
- The district code as an integer.
- Throws:
SOException- If an error occurs during the extraction process.
-
setDistrict
public void setDistrict(int district) Sets the district code for this address. The district is calculated in a cyclic manner based on the total number of districts available for the state. If an error occurs while retrieving the state, a default state of 0 is used.- Parameters:
district- The district code to be set. The value is normalized by taking the modulo with the total number of districts available for the determined state.
-
getDistrictName
Retrieves the name of the district associated with this address.- Returns:
- The district name as a String.
- Throws:
SOException- If an error occurs during the extraction process.
-
getStates
Retrieves the list of states associated with the address.- Returns:
- An array of Strings representing the states.
-
getDistricts
Retrieves the list of districts associated with the specified state.- Parameters:
state- The state code for which the districts are to be retrieved. The value is expected to correspond to an index within the valid range of states.- Returns:
- An array of Strings representing the districts associated with the specified state.
-
getPostalCodeCaption
Description copied from class:AddressGet the caption for the Postal Code.- Overrides:
getPostalCodeCaptionin classAddress- Returns:
- Default implementation returns "Postal Code".
-
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.
-
isPostalCodeMandatory
public boolean isPostalCodeMandatory()Description copied from class:AddressIs postal code mandatory?- Overrides:
isPostalCodeMandatoryin classAddress- Returns:
- True/false.
-
arrangeLines
Description copied from class:AddressThis method is invoked for arranging the address lines to be displayed.- Overrides:
arrangeLinesin classAddress- Parameters:
lines- Address lines.
-