|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.wkt.Formattable org.geotools.referencing.AbstractIdentifiedObject
A base class for metadata applicable to reference system objects.
When AuthorityFactory
is used to create an object, the
authority and authority code values are set to the authority name of the factory object, and the
authority code supplied by the client, respectively. When ObjectFactory
creates an
object, the name is set to the value supplied by the client and
all of the other metadata items are left empty.
This class is conceptually abstract, even if it is technically possible to
instantiate it. Typical applications should create instances of the most specific subclass with
prefix instead. An exception to this rule may occurs when it is not possible to
identify the exact type. For example it is not possible to infer the exact coordinate system from
Well
Known Text is some cases (e.g. in a element). In such exceptional
situation, a plain AbstractCS
object may be instantiated.
Field Summary | |
static org.opengis.util.GenericName[] |
EMPTY_ALIAS_ARRAY
An empty array of alias. |
static org.opengis.metadata.Identifier[] |
EMPTY_IDENTIFIER_ARRAY
An empty array of identifiers. |
static java.util.Comparator |
IDENTIFIER_COMPARATOR
A comparator for sorting identified objects by identifiers. |
static java.util.Comparator |
NAME_COMPARATOR
A comparator for sorting identified objects by name. |
static java.util.Comparator |
REMARKS_COMPARATOR
A comparator for sorting identified objects by remarks. |
Fields inherited from interface org.opengis.referencing.IdentifiedObject |
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY |
Constructor Summary | |
|
AbstractIdentifiedObject(org.opengis.referencing.IdentifiedObject object)
Constructs a new identified object with the same values than the specified one. |
|
AbstractIdentifiedObject(java.util.Map properties)
Constructs an object from a set of properties. |
protected |
AbstractIdentifiedObject(java.util.Map properties,
java.util.Map subProperties,
java.lang.String[] localizables)
Constructs an object from a set of properties and copy unrecognized properties in the specified map. |
Method Summary | |
protected static java.util.Set |
asSet(java.lang.Object[] array)
Returns the specified array as an immutable set, or if the array is empty or null. |
protected static void |
ensureAngularUnit(javax.units.Unit unit)
Makes sure that the specified unit is an angular one. |
protected static void |
ensureLinearUnit(javax.units.Unit unit)
Makes sure that the specified unit is a linear one. |
protected static void |
ensureNonNull(java.lang.String name,
java.lang.Object object)
Makes sure that an argument is non-null. |
protected static void |
ensureNonNull(java.lang.String name,
java.lang.Object[] array,
int index)
Makes sure an array element is non-null. |
protected static void |
ensureTimeUnit(javax.units.Unit unit)
Makes sure that the specified unit is a temporal one. |
boolean |
equals(AbstractIdentifiedObject object,
boolean compareMetadata)
Compares this object with the specified object for equality. |
protected static boolean |
equals(java.util.Collection collection1,
java.util.Collection collection2,
boolean compareMetadata)
Compares two collectionss of OpenGIS's objects for equality. |
protected static boolean |
equals(org.opengis.referencing.IdentifiedObject[] array1,
org.opengis.referencing.IdentifiedObject[] array2,
boolean compareMetadata)
Compares two arrays of OpenGIS's objects for equality. |
protected static boolean |
equals(org.opengis.referencing.IdentifiedObject object1,
org.opengis.referencing.IdentifiedObject object2,
boolean compareMetadata)
Compares two OpenGIS's objects for equality. |
boolean |
equals(java.lang.Object object)
Compares the specified object with this object for equality. |
java.util.Collection |
getAlias()
An alternative name by which this object is identified. |
org.opengis.metadata.Identifier |
getIdentifier(org.opengis.metadata.citation.Citation authority)
Returns an identifier according the given authority. |
static org.opengis.metadata.Identifier |
getIdentifier(org.opengis.referencing.IdentifiedObject info,
org.opengis.metadata.citation.Citation authority)
Returns an identifier according the given authority. |
java.util.Set |
getIdentifiers()
An identifier which references elsewhere the object's defining information. |
org.opengis.metadata.Identifier |
getName()
The primary name by which this object is identified. |
java.lang.String |
getName(org.opengis.metadata.citation.Citation authority)
Returns this object's name according the given authority. |
static java.lang.String |
getName(org.opengis.referencing.IdentifiedObject info,
org.opengis.metadata.citation.Citation authority)
Returns an object's name according the given authority. |
static java.util.Map |
getProperties(org.opengis.referencing.IdentifiedObject info)
Returns the informations provided in the specified indentified object as a map of properties. |
static java.util.Map |
getProperties(org.opengis.referencing.IdentifiedObject info,
org.opengis.metadata.citation.Citation authority)
Returns the properties to be given to an identified object derived from the specified one. |
org.opengis.util.InternationalString |
getRemarks()
Comments on or information about this object, including data source information. |
int |
hashCode()
Returns a hash value for this identified object. |
static boolean |
nameMatches(org.opengis.referencing.IdentifiedObject object,
java.lang.String name)
Returns if either the primary name or at least one alias matches the specified string. |
boolean |
nameMatches(java.lang.String name)
Returns if either the primary name or at least one alias matches the specified string. |
Methods inherited from class org.geotools.referencing.wkt.Formattable |
formatWKT, toString, toWKT, toWKT, toWKT |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.referencing.IdentifiedObject |
toWKT |
Field Detail |
public static final org.opengis.metadata.Identifier[] EMPTY_IDENTIFIER_ARRAY
getIdentifiers().toArray(EMPTY_IDENTIFIER_ARRAY);
public static final org.opengis.util.GenericName[] EMPTY_ALIAS_ARRAY
getAlias().toArray(EMPTY_ALIAS_ARRAY);
public static final java.util.Comparator NAME_COMPARATOR
public static final java.util.Comparator IDENTIFIER_COMPARATOR
public static final java.util.Comparator REMARKS_COMPARATOR
Constructor Detail |
public AbstractIdentifiedObject(org.opengis.referencing.IdentifiedObject object)
public AbstractIdentifiedObject(java.util.Map properties) throws java.lang.IllegalArgumentException
Property name | Value type | Value given to |
---|---|---|
"name" |
String or Identifier |
getName() |
"alias" |
String , String[] ,
GenericName or GenericName[] |
getAlias() |
"authority" |
String or Citation |
Identifier.getAuthority() on the name |
"version" |
String |
Identifier.getVersion() on the name |
"identifiers" |
Identifier or Identifier[] |
getIdentifiers() |
"remarks" |
String or InternationalString |
getRemarks() |
Additionally, all localizable attributes like may have a language and country code suffix. For example the property stands for remarks in French and the property stands for remarks in French Canadian.
Note that the and properties are ignored if the
property is already a Citation
object instead of a String
.
org.opengis.parameter.InvalidParameterValueException
- if a property has an invalid value.
java.lang.IllegalArgumentException
- if a property is invalid for some other reason.protected AbstractIdentifiedObject(java.util.Map properties, java.util.Map subProperties, java.lang.String[] localizables) throws java.lang.IllegalArgumentException
If is non-null, then all keys listed in this argument are
treated as localizable one (i.e. may have a suffix like "_fr", "_de", etc.). Localizable
properties are stored in the map as InternationalString
objects.
properties
- Set of properties. Should contains at least .subProperties
- The map in which to copy unrecognized properties.localizables
- Optional list of localized properties.
org.opengis.parameter.InvalidParameterValueException
- if a property has an invalid value.
java.lang.IllegalArgumentException
- if a property is invalid for some other reason.Method Detail |
public org.opengis.metadata.Identifier getName()
getName
in interface org.opengis.referencing.IdentifiedObject
getName(Citation)
public java.util.Collection getAlias()
getAlias
in interface org.opengis.referencing.IdentifiedObject
getName(Citation)
public java.util.Set getIdentifiers()
getIdentifiers
in interface org.opengis.referencing.IdentifiedObject
getIdentifier(Citation)
public org.opengis.util.InternationalString getRemarks()
getRemarks
in interface org.opengis.referencing.IdentifiedObject
public static java.util.Map getProperties(org.opengis.referencing.IdentifiedObject info)
NAME_KEY
, and
values from methods such as getName()
.
info
- The identified object to view as a properties map.
public static java.util.Map getProperties(org.opengis.referencing.IdentifiedObject info, org.opengis.metadata.citation.Citation authority)
getProperties(info)
), except for
the following:
This method returns a mutable map. Consequently, callers can add their own identifiers directly to this map if they wish.
info
- The identified object to view as a properties map.authority
- The new authority for the object to be created, or if it
is not going to have any declared authority.
public org.opengis.metadata.Identifier getIdentifier(org.opengis.metadata.citation.Citation authority)
identifiers
in their iteration order. It returns the first
identifier with an authority citation
matching the specified
authority.
authority
- The authority for the identifier to return.
public static org.opengis.metadata.Identifier getIdentifier(org.opengis.referencing.IdentifiedObject info, org.opengis.metadata.citation.Citation authority)
getIdentifier(Citation)
on arbitrary implementations of GeoAPI interface.
info
- The object to get the identifier from.authority
- The authority for the identifier to return.
public java.lang.String getName(org.opengis.metadata.citation.Citation authority)
alias
in their iteration
order.
If the name or alias implements the Identifier
interface, then this method
compares the identifier authority against the
specified citation using the identifierMatches
method. If a matching is found, then this method returns the
identifier code of this object.
Otherwise, if the alias implements the GenericName
interface, then this
method compares the name scope against the specified
citation using the identifierMatches method. If a matching is found, then this method returns the
local name of this object.
Identifier
and GenericName
interfaces
(for example NamedIdentifier
). In such cases, the identifier view has precedence.
authority
- The authority for the name to return.
getName()
,
getAlias()
public static java.lang.String getName(org.opengis.referencing.IdentifiedObject info, org.opengis.metadata.citation.Citation authority)
getName(Citation)
on arbitrary implementations of GeoAPI interface.
info
- The object to get the name from.authority
- The authority for the name to return.
public boolean nameMatches(java.lang.String name)
name
- The name to compare.
public static boolean nameMatches(org.opengis.referencing.IdentifiedObject object, java.lang.String name)
object
- The object to check.name
- The name.
public final boolean equals(java.lang.Object object)
object
- The other object (may be ).
public boolean equals(AbstractIdentifiedObject object, boolean compareMetadata)
getName()
saids.
Some subclasses (especially AbstractDatum
and AbstractParameterDescriptor
) will test for the
name, since objects with different name have completly
different meaning. For example nothing differentiate the and
parameters except the name. The name comparaison may be loose
however, i.e. we may accept a name matching an alias.
object
- The object to compare to .compareMetadata
- for performing a strict comparaison, or
for comparing only properties relevant to transformations.
protected static boolean equals(org.opengis.referencing.IdentifiedObject object1, org.opengis.referencing.IdentifiedObject object2, boolean compareMetadata)
object1
- The first object to compare (may be ).object2
- The second object to compare (may be ).compareMetadata
- for performing a strict comparaison, or
for comparing only properties relevant to transformations.
protected static boolean equals(org.opengis.referencing.IdentifiedObject[] array1, org.opengis.referencing.IdentifiedObject[] array2, boolean compareMetadata)
array1
- The first array to compare (may be ).array2
- The second array to compare (may be ).compareMetadata
- for performing a strict comparaison, or
for comparing only properties relevant to transformations.
protected static boolean equals(java.util.Collection collection1, java.util.Collection collection2, boolean compareMetadata)
List
or LinkedHashSet
comparaisons. This convenience method is provided for
implementation of method in subclasses.
collection1
- The first collection to compare (may be ).collection2
- The second collection to compare (may be ).compareMetadata
- for performing a strict comparaison, or
for comparing only properties relevant to transformations.
public int hashCode()
equals
(AbstractIdentifiedObject,
false)
.
protected static java.util.Set asSet(java.lang.Object[] array)
array
- The array to copy in a set. May be .
protected static void ensureNonNull(java.lang.String name, java.lang.Object object) throws java.lang.IllegalArgumentException
name
- Argument name.object
- User argument.
org.opengis.parameter.InvalidParameterValueException
- if is null.
java.lang.IllegalArgumentException
protected static void ensureNonNull(java.lang.String name, java.lang.Object[] array, int index) throws java.lang.IllegalArgumentException
name
- Argument name.array
- User argument.index
- Index of the element to check.
org.opengis.parameter.InvalidParameterValueException
- if is null.
java.lang.IllegalArgumentException
protected static void ensureTimeUnit(javax.units.Unit unit) throws java.lang.IllegalArgumentException
unit
- Unit to check.
java.lang.IllegalArgumentException
- if is not a temporal unit.protected static void ensureLinearUnit(javax.units.Unit unit) throws java.lang.IllegalArgumentException
unit
- Unit to check.
java.lang.IllegalArgumentException
- if is not a linear unit.protected static void ensureAngularUnit(javax.units.Unit unit) throws java.lang.IllegalArgumentException
unit
- Unit to check.
java.lang.IllegalArgumentException
- if is not an angular unit.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |