public class Adm extends GisFeature
Country
(Region, Province, state,
Department, and so on)LOCATION_COLUMN_NAME, logger, MAX_ALTERNATENAME_SIZE, NAME_MAX_LENGTH, SHAPE_COLUMN_NAME
Modifier | Constructor and Description |
---|---|
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) |
Modifier and Type | Method and Description |
---|---|
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() |
addAlternateName, addAlternateNames, addIsInCitiesAlternateName, addIsInCitiesAlternateNames, addZip, addZipCode, addZipCodes, addZips, distanceTo, getAdm, getAdm1Code, getAdm1Name, getAdm2Code, getAdm2Name, getAdm3Code, getAdm3Name, getAdm4Code, getAdm4Name, getAdm5Code, getAdm5Name, getAlternateNames, getAmenity, getAsciiName, getCountry, getCountryCode, getElevation, getFeatureClass, getFeatureCode, getFeatureId, getFullyQualifiedName, getFullyQualifiedName, getGtopo30, getId, getIsIn, getIsInAdm, getIsInCityAlternateNames, getIsInPlace, getIsInZip, getLatitude, getLocation, getLongitude, getModificationDate, getName, getOpenstreetmapId, getPopulation, getShape, getSource, getTimezone, getZipCodes, isAdm, isCity, isCountry, isFullTextSearchable, populate, setAdm, setAdm1Code, setAdm1Name, setAdm2Code, setAdm2Name, setAdm3Code, setAdm3Name, setAdm4Code, setAdm4Name, setAdm5Code, setAdm5Name, setAlternateNames, setAmenity, setAsciiName, setCountryCode, setElevation, setFeatureClass, setFeatureCode, setFeatureId, setGtopo30, setId, setIsIn, setIsInAdm, setIsInCityAlternateNames, setIsInPlace, setIsInZip, setLocation, setModificationDate, setName, setOpenstreetmapId, setPopulation, setShape, setSource, setTimezone, setZipCodes
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()
public boolean isConsistentForLevel()
public Integer getLevel()
public void setLevel(Integer level)
IllegalArgumentException
level
- The Level to setIllegalArgumentException
- If level is not correctpublic void addChild(Adm child)
child
- The child to addIllegalArgumentException
- 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 testpublic static int getProcessedLevelFromFeatureClassCode(String featureClass, String featureCode)
featureClass
- The featureClass of the Adm to testfeatureCode
- The featureCode of the Adm to Testpublic 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
Copyright © 2015. All rights reserved.