Adempiere 3.5.2a

org.compiere.model
Class MLocation

java.lang.Object
  extended by org.compiere.model.PO
      extended by org.compiere.model.X_C_Location
          extended by org.compiere.model.MLocation
All Implemented Interfaces:
Serializable, Comparator, I_C_Location, I_Persistent, Evaluatee

public class MLocation
extends X_C_Location
implements Comparator

Loaction (Address)

Version:
$Id: MLocation.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Fields inherited from interface org.compiere.model.I_C_Location
accessLevel, COLUMNNAME_Address1, COLUMNNAME_Address2, COLUMNNAME_Address3, COLUMNNAME_Address4, COLUMNNAME_C_City_ID, COLUMNNAME_C_Country_ID, COLUMNNAME_C_Location_ID, COLUMNNAME_C_Region_ID, COLUMNNAME_City, COLUMNNAME_Postal, COLUMNNAME_Postal_Add, COLUMNNAME_RegionName, Model, Table_ID, Table_Name
 
Constructor Summary
MLocation(MCountry country, MRegion region)
          Parent Constructor
MLocation(Properties ctx, int C_Country_ID, int C_Region_ID, String city, String trxName)
          Full Constructor
MLocation(Properties ctx, int C_Location_ID, String trxName)
          Standard Constructor
MLocation(Properties ctx, ResultSet rs, String trxName)
          Load Constructor
 
Method Summary
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save
protected  boolean beforeSave(boolean newRecord)
          Before Save
 boolean equals(int C_Country_ID, int C_Region_ID, String Postal, String Postal_Add, String City, String Address1, String Address2)
          Compares to current record
 boolean equals(Object cmp)
          Equals
static MLocation get(Properties ctx, int C_Location_ID, String trxName)
          Get Location from Cache
static MLocation getBPLocation(Properties ctx, int C_BPartner_Location_ID, String trxName)
          Load Location with ID if Business Partner Location
 String getCityRegionPostal()
          Get formatted City Region Postal line
 MCountry getCountry()
          Get Country
 String getCountry(boolean local)
          Get Country Line
 String getCountryName()
          Get Country Name
 MRegion getRegion()
          Get Region
 String getRegionName()
          Get (local) Region Name
 String getRegionName(boolean getFromRegion)
          Get Region Name
 boolean isAddressLinesReverse()
          Print Address Reverse Order
 void setC_Country_ID(int C_Country_ID)
          Set C_Country_ID
 void setC_Region_ID(int C_Region_ID)
          Set C_Region_ID
 void setCountry(MCountry country)
          Set Country
 void setRegion(MRegion region)
          Set Region
 String toString()
          Return printable String representation
 String toStringCR()
          Return String representation with CR at line end
 String toStringX()
          Return detailed String representation
 
Methods inherited from class org.compiere.model.X_C_Location
get_AccessLevel, getAddress1, getAddress2, getAddress3, getAddress4, getC_City_ID, getC_City, getC_Country_ID, getC_Country, getC_Location_ID, getC_Region_ID, getC_Region, getCity, getKeyNamePair, getPostal_Add, getPostal, initPO, setAddress1, setAddress2, setAddress3, setAddress4, setC_City_ID, setC_Location_ID, setCity, setPostal_Add, setPostal, setRegionName
 
Methods inherited from class org.compiere.model.PO
afterDelete, beforeDelete, compare, copyValues, copyValues, createAttachment, delete_Accounting, delete_Tree, delete, delete, deleteEx, deleteEx, dump, dump, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveEx, saveEx, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setDoc, setDocWorkflowMgr, setIsActive, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
compare
 
Methods inherited from interface org.compiere.model.I_Persistent
save
 

Constructor Detail

MLocation

public MLocation(Properties ctx,
                 int C_Location_ID,
                 String trxName)
Standard Constructor

Parameters:
ctx - context
C_Location_ID - id
trxName - transaction

MLocation

public MLocation(MCountry country,
                 MRegion region)
Parent Constructor

Parameters:
country - mandatory country
region - optional region

MLocation

public MLocation(Properties ctx,
                 int C_Country_ID,
                 int C_Region_ID,
                 String city,
                 String trxName)
Full Constructor

Parameters:
ctx - context
C_Country_ID - country
C_Region_ID - region
city - city
trxName - transaction

MLocation

public MLocation(Properties ctx,
                 ResultSet rs,
                 String trxName)
Load Constructor

Parameters:
ctx - context
rs - result set
trxName - transaction
Method Detail

get

public static MLocation get(Properties ctx,
                            int C_Location_ID,
                            String trxName)
Get Location from Cache

Parameters:
ctx - context
C_Location_ID - id
trxName - transaction
Returns:
MLocation

getBPLocation

public static MLocation getBPLocation(Properties ctx,
                                      int C_BPartner_Location_ID,
                                      String trxName)
Load Location with ID if Business Partner Location

Parameters:
ctx - context
C_BPartner_Location_ID - Business Partner Location
trxName - transaction
Returns:
loaction or null

setCountry

public void setCountry(MCountry country)
Set Country

Parameters:
country -

setC_Country_ID

public void setC_Country_ID(int C_Country_ID)
Set C_Country_ID

Specified by:
setC_Country_ID in interface I_C_Location
Overrides:
setC_Country_ID in class X_C_Location
Parameters:
C_Country_ID - id

getCountry

public MCountry getCountry()
Get Country

Returns:
country

getCountryName

public String getCountryName()
Get Country Name

Returns:
Country Name

getCountry

public String getCountry(boolean local)
Get Country Line

Parameters:
local - if true only foreign country is returned
Returns:
country or null

setRegion

public void setRegion(MRegion region)
Set Region

Parameters:
region -

setC_Region_ID

public void setC_Region_ID(int C_Region_ID)
Set C_Region_ID

Specified by:
setC_Region_ID in interface I_C_Location
Overrides:
setC_Region_ID in class X_C_Location
Parameters:
C_Region_ID - region

getRegion

public MRegion getRegion()
Get Region

Returns:
region

getRegionName

public String getRegionName()
Get (local) Region Name

Specified by:
getRegionName in interface I_C_Location
Overrides:
getRegionName in class X_C_Location
Returns:
region Name or ""

getRegionName

public String getRegionName(boolean getFromRegion)
Get Region Name

Parameters:
getFromRegion - get from region (not locally)
Returns:
region Name or ""

equals

public boolean equals(int C_Country_ID,
                      int C_Region_ID,
                      String Postal,
                      String Postal_Add,
                      String City,
                      String Address1,
                      String Address2)
Compares to current record

Parameters:
C_Country_ID - if 0 ignored
C_Region_ID - if 0 ignored
Postal - match postal
Postal_Add - match postal add
City - match city
Address1 - match address 1
Address2 - match addtess 2
Returns:
true if equals

equals

public boolean equals(Object cmp)
Equals

Specified by:
equals in interface Comparator
Overrides:
equals in class PO
Parameters:
cmp - comperator
Returns:
true if ID the same

isAddressLinesReverse

public boolean isAddressLinesReverse()
Print Address Reverse Order

Returns:
true if reverse depending on country

getCityRegionPostal

public String getCityRegionPostal()
Get formatted City Region Postal line

Returns:
City, Region Postal

toString

public String toString()
Return printable String representation

Overrides:
toString in class X_C_Location
Returns:
String

toStringCR

public String toStringCR()
Return String representation with CR at line end

Returns:
String

toStringX

public String toStringX()
Return detailed String representation

Returns:
String

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord - new
Returns:
true

afterSave

protected boolean afterSave(boolean newRecord,
                            boolean success)
After Save

Overrides:
afterSave in class PO
Parameters:
newRecord - new
success - success
Returns:
success

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.