|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gisgraphy.domain.geoloc.entity.GisFeature
com.gisgraphy.domain.geoloc.entity.Adm
public class Adm
Represents a (sub) division of a Country
(Region, Province, state,
Department, and so on)
Adm are in tree structure. An Adm can have some children and MUST
have a parent if the Level is > 1 (an Adm with level 1 is to be a 'ROOT' Adm)
Field Summary |
---|
Fields inherited from class com.gisgraphy.domain.geoloc.entity.GisFeature |
---|
LOCATION_COLUMN_NAME, logger |
Constructor Summary | |
---|---|
protected |
Adm()
Default constructor (Needed by CGLib) |
|
Adm(GisFeature gisFeature,
Integer level)
Constructor that populate the Adm with the gisFeature fields and set the level note The feature class will be set to 'A' and The feature code will be set according to the Level (ADM + level) |
|
Adm(Integer level)
Constructor that create an Adm for the specified level note the feature class will be set to 'A' and The feature code will be set according to the Level (ADM + level) |
Method Summary | |
---|---|
void |
addChild(Adm child)
Do a double set : Add (not replace ! |
void |
addChildren(List<Adm> children)
Do a double set : Add (not replace !) |
boolean |
equals(Object obj)
|
List<Adm> |
getChildren()
Return the Adms of a directly higher Level in the adm the tree structure |
Integer |
getLevel()
|
Adm |
getParent()
Returns The parent Adm in the Adm tree structure |
static int |
getProcessedLevelFromCodes(String adm1Code,
String adm2Code,
String adm3Code,
String adm4Code)
Determine what should be the level of an Adm which have the provided codes |
static int |
getProcessedLevelFromFeatureClassCode(String featureClass,
String featureCode)
Determine what should be the level of an adm which have a the specified featureClass and a featureCode. |
int |
hashCode()
|
boolean |
isConsistentForLevel()
Check that the country code is filled and the admXcode are correctly filled according to the level |
void |
setChildren(List<Adm> children)
Set the Adms of a directly higher level |
void |
setLevel(Integer level)
Set the level and Check that 1<= level<= 4. |
void |
setParent(Adm parent)
Set the parent Adm in the tree structure |
String |
toString()
|
Methods inherited from class com.gisgraphy.domain.geoloc.entity.GisFeature |
---|
addAlternateName, addAlternateNames, addZipCode, addZipCodes, distanceTo, getAdm, getAdm1Code, getAdm1Name, getAdm2Code, getAdm2Name, getAdm3Code, getAdm3Name, getAdm4Code, getAdm4Name, getAlternateNames, getAsciiName, getCountry, getCountryCode, getElevation, getFeatureClass, getFeatureCode, getFeatureId, getFullyQualifiedName, getFullyQualifiedName, getGtopo30, getId, getLatitude, getLocation, getLongitude, getModificationDate, getName, getPopulation, getSource, getTimezone, getZipCodes, isAdm, isCity, isCountry, isFullTextSearchable, populate, setAdm, setAdm1Code, setAdm1Name, setAdm2Code, setAdm2Name, setAdm3Code, setAdm3Name, setAdm4Code, setAdm4Name, setAlternateNames, setAsciiName, setCountryCode, setElevation, setFeatureClass, setFeatureCode, setFeatureId, setGtopo30, setId, setLocation, setModificationDate, setName, setPopulation, setSource, setTimezone, setZipCodes |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Adm(GisFeature gisFeature, Integer level)
gisFeature
- The gisFeature we want to populate the
Admlevel
- The level of the Admpublic Adm(Integer level)
level
- The level of the Admprotected Adm()
Method Detail |
---|
public boolean isConsistentForLevel()
public Integer getLevel()
public void setLevel(Integer level)
IllegalArgumentException
level
- The Level to set
IllegalArgumentException
- If level is not correctpublic void addChild(Adm child)
child
- The child to add
IllegalArgumentException
- if the level of the child
is not equals to the level of this Adm +1public void addChildren(List<Adm> children)
children
- The children to addaddChild(Adm)
public List<Adm> getChildren()
public void setChildren(List<Adm> children)
children
- the children for the current Admpublic Adm getParent()
public void setParent(Adm parent)
parent
- the Parent Adm to setpublic static int getProcessedLevelFromCodes(String adm1Code, String adm2Code, String adm3Code, String adm4Code)
adm1Code
- The Adm1Code of the Adm to testadm2Code
- The Adm2Code of the Adm to testadm3Code
- The Adm3Code of the Adm to testadm4Code
- The Adm4Code of the Adm to test
public static int getProcessedLevelFromFeatureClassCode(String featureClass, String featureCode)
featureClass
- The featureClass of the Adm to testfeatureCode
- The featureCode of the Adm to Test
public int hashCode()
hashCode
in class GisFeature
public boolean equals(Object obj)
equals
in class GisFeature
GisFeature.equals(java.lang.Object)
public String toString()
toString
in class GisFeature
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |