Package com.storedobject.common
Class MYAddress
java.lang.Object
com.storedobject.common.Address
com.storedobject.common.MYAddress
MY Address
line[0]: Postal town
line[1]: State code
line[0]: Postal town
line[1]: State code
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionprotected Stringconvert(int lineNumber) Get the caption for the "area" line.intGet the number of extra lines.Get the caption for the Post Box.intWhat is the maximum length of the postal code?Retrieves the postal town from the address data.intgetState()Retrieves the state value derived from the address data.Retrieves the name of the state from the address data.static String[]Retrieves the array of state names available in the address data.protected booleanparse()voidsetPostalTown(String name) Sets the postal town for the address.voidsetState(int state) Updates the state value in the address data.Methods inherited from class com.storedobject.common.Address
arrangeLines, check, check, copy, create, create, encode, getApartmentName, getAreaName, getBuildingName, getCountry, getHouseName, getLine, getOfficeName, getPOBox, getPostalCode, getPostalCodeCaption, getPostalCodeMinLength, getStreetName, getType, getTypeValue, getTypeValue, getTypeValues, getVillaName, isNumericPostalCode, isPOBoxAddress, isPostalCodeAddress, isPostalCodeMandatory, isValid, poBoxPrefix, poBoxSuffix, setApartmentName, setAreaName, setBuildingName, setHouseName, setLine, setOfficeName, setPOBox, setPostalCode, setStreetName, setType, setVillaName, toString, toString, validate
-
Method Details
-
parse
- Throws:
SOException
-
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.
-
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
-
getPostalTown
Retrieves the postal town from the address data. The postal town is derived from the last element in the address array, offset by a predefined position value.- Returns:
- the postal town as a String
-
setPostalTown
Sets the postal town for the address. Updates the address data with the provided postal town, replacing the existing value. If the input is null, the postal town is set to an empty string.- Parameters:
name- the name of the postal town to be set. If null, it is replaced with an empty string.
-
getState
Retrieves the state value derived from the address data. The state is calculated based on a specific line in the address, determined using the length of the lines and a predefined position constant.- Returns:
- the state value as an integer.
- Throws:
SOException- if an error occurs during the extraction process.
-
setState
public void setState(int state) Updates the state value in the address data. The state is set based on the provided integer value and stored in the corresponding line of the address array, calculated using the predefined position constant.- Parameters:
state- the integer value representing the state to be set. The value is normalized by computing the remainder when divided by the length of the states array.
-
getStateName
Retrieves the name of the state from the address data. The state name is derived from the states array based on a calculated position determined by the length of the lines and a predefined position constant.- Returns:
- the name of the state as a String.
-
getStates
Retrieves the array of state names available in the address data. The list of states is predefined and stored in an internal array.- Returns:
- an array of Strings containing the names of all available states.
-
getPOBoxName
Description copied from class:AddressGet the caption for the Post Box.- Overrides:
getPOBoxNamein classAddress- Returns:
- Default implementation returns "Post Box".
-
getAreaCaption
Description copied from class:AddressGet the caption for the "area" line.- Overrides:
getAreaCaptionin classAddress- Returns:
- Default implementation returns "Area".
-