org.cts
Class IdentifiableComponent

java.lang.Object
  extended by org.cts.IdentifiableComponent
All Implemented Interfaces:
Identifiable
Direct Known Subclasses:
AbstractCoordinateOperation, AbstractDatum, Ellipsoid, GeodeticCRS, PrimeMeridian, Unit, VerticalCRS

public class IdentifiableComponent
extends Object
implements Identifiable

IdentifiableComponent is a helper class used as a parent class for components having to implement the Identifiable interface. Instead of implementing Identifiable methods in each component class, the programmer just has to extends IdentifiableComponent.

Author:
Michaƫl Michaud

Field Summary
 
Fields inherited from interface org.cts.Identifiable
DEFAULT, LOCAL, UNKNOWN
 
Constructor Summary
IdentifiableComponent(Identifier identifier)
          Creates an identifiable component from an identifier.
 
Method Summary
 boolean addAlias(Identifiable alias)
          Add an alias
 void addRemark(String new_remark)
          Add remarks.
 boolean equals(Object object)
          Returns true if object is an Identifier equals to this one.
 List<Identifiable> getAliases()
          Get aliases
 String getAuthorityKey()
          Returns the id of this identifier (id must be unique inside a namespace).
 String getAuthorityName()
          Return the namespace of this identifier (ex.
 String getCode()
          Returns a code formed with a namespace, ':' and the id value of identifier (ex.
static IdentifiableComponent getComponent(Identifier id)
          Get the component based on its identifier
 Identifier getIdentifier()
          Return this component's Identifier
 String getName()
          Returns a string used to identify clearly the object.
 String getRemarks()
          Returns the name of this extent.
 String getShortName()
          Returns a short string used to identify unambiguously the object.
 int hashCode()
          Returns a hash code for this IdentifiableComponent.
protected  void setIdentifier(Identifier identifier)
          Change this component's Identifier
 void setRemarks(String remarks)
          Change the remarks.
 void setShortName(String uiName)
          Change the short string used to identify unambiguously the object.
 String toString()
          Returns a String representation of this identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentifiableComponent

public IdentifiableComponent(Identifier identifier)
Creates an identifiable component from an identifier.

Parameters:
identifier - the identifier of the component
Method Detail

getIdentifier

public Identifier getIdentifier()
Return this component's Identifier


setIdentifier

protected void setIdentifier(Identifier identifier)
Change this component's Identifier

Parameters:
identifier - the new identifier of the component

getAuthorityName

public String getAuthorityName()
Return the namespace of this identifier (ex. EPSG, IGNF) The namespace may represent a database name, a URL, a URN...

Specified by:
getAuthorityName in interface Identifiable

getAuthorityKey

public String getAuthorityKey()
Returns the id of this identifier (id must be unique inside a namespace).

Specified by:
getAuthorityKey in interface Identifiable

getCode

public String getCode()
Returns a code formed with a namespace, ':' and the id value of identifier (ex. EPSG:27572).

Specified by:
getCode in interface Identifiable
Returns:
a String of the form namespace:identifier

getName

public String getName()
Returns a string used to identify clearly the object.

Specified by:
getName in interface Identifiable

getShortName

public String getShortName()
Returns a short string used to identify unambiguously the object. The string must have a maximum of 16 characters to fit menus with ease.

Specified by:
getShortName in interface Identifiable

setShortName

public void setShortName(String uiName)
Change the short string used to identify unambiguously the object. The string must have a maximum of 16 characters to fit menus with ease.

Specified by:
setShortName in interface Identifiable
Parameters:
uiName - the new short name of the component

getRemarks

public String getRemarks()
Returns the name of this extent.

Specified by:
getRemarks in interface Identifiable

setRemarks

public void setRemarks(String remarks)
Change the remarks. Be careful, this method will delete former remarks.

Specified by:
setRemarks in interface Identifiable
Parameters:
remarks - the new remarks of the component

addRemark

public void addRemark(String new_remark)
Add remarks.

Specified by:
addRemark in interface Identifiable
Parameters:
new_remark - the remark to add to the component

getAliases

public List<Identifiable> getAliases()
Get aliases

Specified by:
getAliases in interface Identifiable

addAlias

public boolean addAlias(Identifiable alias)
Add an alias

Specified by:
addAlias in interface Identifiable
Parameters:
alias - an alias for this object

getComponent

public static IdentifiableComponent getComponent(Identifier id)
Get the component based on its identifier

Parameters:
id -
Returns:

equals

public boolean equals(Object object)
Returns true if object is an Identifier equals to this one.

Overrides:
equals in class Object
Parameters:
object - The object to compare this IdentifiableComponent against

hashCode

public int hashCode()
Returns a hash code for this IdentifiableComponent.

Overrides:
hashCode in class Object

toString

public String toString()
Returns a String representation of this identifier.

Overrides:
toString in class Object


Copyright © 2014 IRSTV CNRS-FR-2488. All Rights Reserved.