public class ModifiableLocationType extends Object
ModifiableLocationType
instances are modifiable, they should not be published directly.
Instead, unmodifiable snapshots should be published.
The same ModifiableLocationType
instance can be used for many snapshots.
street
location
type has two parents, town
and area
, because a street can be outside any town and
directly under the authority of an administrative area instead.
ModifiableLocationType area = new ModifiableLocationType("administrative area"); ModifiableLocationType town = new ModifiableLocationType("town"); ModifiableLocationType street = new ModifiableLocationType("street"); area .setTheme("local administration"); town .setTheme("built environment"); street.setTheme("access"); area .setDefinition("area of responsibility of highest level local authority"); town .setDefinition("city or town"); street.setDefinition("thoroughfare providing access to properties"); town .addParent(area); street.addParent(area); street.addParent(town);A string representation of the
area
location type is as below:
administrative area………………… area of responsibility of highest level local authority ├─town……………………………………………… city or town │ └─street……………………………… thoroughfare providing access to properties └─street………………………………………… thoroughfare providing access to properties
area.setTerritoryOfUse("Japan");Then, the towns and streets automatically inherit the same value for that property, unless they are explicitely given another value.
AbstractLocation
,
ReferencingByIdentifiers
Defined in the sis-referencing-by-identifiers
module
Constructor and Description |
---|
ModifiableLocationType(CharSequence name)
Creates a new location type of the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addIdentification(CharSequence value)
Adds a method of uniquely identifying location instances.
|
void |
addParent(ModifiableLocationType parent)
Adds the given element to the list of parents.
|
boolean |
equals(Object object)
Compares this location type with the specified object for strict equality.
|
boolean |
equals(Object object,
ComparisonMode mode)
Compares this location type with the specified object for equality.
|
Collection<ModifiableLocationType> |
getChildren()
Returns the child location types (location types which sub-divides this location type).
|
InternationalString |
getDefinition()
Returns the way in which location instances are defined.
|
Collection<InternationalString> |
getIdentifications()
Returns the method(s) of uniquely identifying location instances.
|
InternationalString |
getName()
Returns the name of the location type.
|
AbstractParty |
getOwner()
Returns the name of organization or class of organization able to create and destroy location instances.
|
Collection<ModifiableLocationType> |
getParents()
Returns the parent location types (location types of which this location type is a sub-division).
|
ReferencingByIdentifiers |
getReferenceSystem()
Returns the reference system that comprises this location type.
|
GeographicExtent |
getTerritoryOfUse()
Returns the geographic area within which the location type occurs.
|
InternationalString |
getTheme()
Returns the property used as the defining characteristic of the location type.
|
int |
hashCode()
Returns a hash code value for this location type.
|
void |
removeIdentification(CharSequence value)
Removes a method of uniquely identifying location instances.
|
void |
removeParent(ModifiableLocationType parent)
Removes the given element from the list of parent.
|
void |
setDefinition(CharSequence value)
Sets the way in which location instances are defined.
|
void |
setOwner(AbstractParty value)
Sets the organization or class of organization able to create and destroy location instances.
|
void |
setOwner(CharSequence name)
Sets the name of the organization or class of organization able to create and destroy location instances.
|
void |
setTerritoryOfUse(GeographicExtent value)
Sets the geographic area within which the location type occurs.
|
void |
setTerritoryOfUse(String identifier)
Sets the name of the geographic area within which the location type occurs.
|
void |
setTheme(CharSequence value)
Sets the property used as the defining characteristic of the location type.
|
static List<AbstractLocationType> |
snapshot(ReferencingByIdentifiers rs,
AbstractLocationType... types)
Creates unmodifiable snapshots of the given location types.
|
String |
toString()
Returns a string representation of this location type and all its children.
|
public ModifiableLocationType(CharSequence name)
name
- the location type name.public InternationalString getName()
public InternationalString getTheme()
null
if no value has been defined or can be inherited.ReferencingByIdentifiers.getTheme()
public void setTheme(CharSequence value)
value
- the new theme, or null
for inheriting a value from the parents.public Collection<InternationalString> getIdentifications()
addIdentification(CharSequence)
or removeIdentification(CharSequence)
.AbstractLocation.getGeographicIdentifier()
public void addIdentification(CharSequence value)
value
- the method to add.IllegalArgumentException
- if the given value is already defined.public void removeIdentification(CharSequence value)
value
- the method to remove.IllegalArgumentException
- if the given value is not found.public InternationalString getDefinition()
null
if no value has been defined or can be inherited.public void setDefinition(CharSequence value)
value
- the new identification.public GeographicExtent getTerritoryOfUse()
null
if no value has been defined or can be inherited.AbstractReferenceSystem.getDomainOfValidity()
public void setTerritoryOfUse(GeographicExtent value)
DefaultGeographicBoundingBox
. For an alternative where only the
territory name is specified, see setTerritoryOfUse(String)
.value
- the new geographic extent.public void setTerritoryOfUse(String identifier)
identifier
- the identifier of the geographic extent.public AbstractParty getOwner()
org.opengis.metadata.citation.Party
interface. This change is pending
GeoAPI revision for upgrade from ISO 19115:2003 to ISO 19115:2014.null
if no value has been defined or can be inherited.AbstractLocation.getAdministrator()
,
ReferencingByIdentifiers.getOverallOwner()
public void setOwner(AbstractParty value)
DefaultOrganisation
.
For an alternative where only the organization name is specified, see setOwner(CharSequence)
.
org.opengis.metadata.citation.Party
interface. This change is pending
GeoAPI revision for upgrade from ISO 19115:2003 to ISO 19115:2014.value
- the new owner.public void setOwner(CharSequence name)
name
- the organization name.public final Collection<ModifiableLocationType> getParents()
The collection returned by this method is unmodifiable. For adding or removing a parent,
use addParent(ModifiableLocationType)
or removeParent(ModifiableLocationType)
.
AbstractLocation.getParents()
public final Collection<ModifiableLocationType> getChildren()
child.addParent(this)
or child.removeParent(this)
.AbstractLocation.getChildren()
public void addParent(ModifiableLocationType parent)
parent
- the parent to add.IllegalStateException
- if this location type already have a parent of the same name.IllegalArgumentException
- if the given parent already have a child of the same name than this location type.public void removeParent(ModifiableLocationType parent)
parent
- the parent to remove.IllegalArgumentException
- if the given parent has not been found.public ReferencingByIdentifiers getReferenceSystem()
ModifiableLocationType
s,
the reference system is always null. The reference system is defined when the location types are
given to the ReferencingByIdentifiers
constructor for example.
org.opengis.referencing.gazetteer.ReferenceSystemUsingIdentifiers
interface.
This change is pending GeoAPI revision.null
.ReferencingByIdentifiers.getLocationTypes()
public static List<AbstractLocationType> snapshot(ReferencingByIdentifiers rs, AbstractLocationType... types)
The location types returned by this method are serializable if all properties (name, territory of use, etc. are also serializable).
rs
- the reference system to assign to the new location types, or null
if none.types
- the location types for which to take a snapshot.public boolean equals(Object object, ComparisonMode mode)
getName()
and getChildren()
in all modes.
At the opposite, values of getParents()
and getReferenceSystem()
are never
compared, no matter the mode, for avoiding never-ending loops. Other properties may or may
not be compared depending on the mode
argument.
If the mode
argument value is STRICT
or
BY_CONTRACT
, then almost all properties are compared
including the theme and the owner.
equals
in interface LenientComparable
object
- the object to compare to this
.mode
- STRICT
for performing a strict comparison, or
IGNORE_METADATA
for comparing only
properties relevant to location identifications.true
if both objects are equal.Utilities.deepEquals(Object, Object, ComparisonMode)
public final boolean equals(Object object)
getParents()
and getReferenceSystem()
, for avoiding never-ending loops.
This method is implemented as below:
return equals(object, ComparisonMode.STRICT);
equals
in interface LenientComparable
equals
in class Object
object
- the object to compare to this
.true
if both objects are equal.ComparisonMode.STRICT
public int hashCode()
public String toString()
administrative area………………… area of responsibility of highest level local authority ├─town……………………………………………… city or town │ └─street……………………………… thoroughfare providing access to properties └─street………………………………………… thoroughfare providing access to propertiesThe string representation is mostly for debugging purpose and may change in any future SIS version.
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.