|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.lehmannet.om.SchemaElement
de.lehmannet.om.Target
public abstract class Target
The abstract class Target provides some common features that may be
used by the subclasses of an de.lehmannet.om.ITarget.
The Target class stores the name, alias names and the position of an
astronomical object. It also provides some basic access methods
for these attributes.
Additionally It implements a basic XML DOM
helper method that may be used by all subclasses that have to implement
the ITarget interface.
| Field Summary |
|---|
| Fields inherited from interface de.lehmannet.om.ITarget |
|---|
XML_ELEMENT_ALIASNAME, XML_ELEMENT_CONSTELLATION, XML_ELEMENT_DATASOURCE, XML_ELEMENT_NAME, XML_ELEMENT_TARGET, XML_XSI_TYPE |
| Fields inherited from interface de.lehmannet.om.ISchemaElement |
|---|
XML_ELEMENT_ATTRIBUTE_ID |
| Constructor Summary | |
|---|---|
protected |
Target(org.w3c.dom.Node targetElement,
IObserver[] observers)
Constructs a new instance of a Target from a given DOM target Element. |
protected |
Target(java.lang.String name,
IObserver observer)
Protected Constructor used by subclasses construction. |
protected |
Target(java.lang.String name,
java.lang.String datasource)
Protected Constructor used by subclasses construction. |
| Method Summary | |
|---|---|
boolean |
addAliasName(java.lang.String newAliasName)
Adds a new alias name to the Target e.g. name = M42 ; alias name = "Great Orion Nebulae" |
boolean |
addAliasNames(java.lang.String aliasNames)
Adds a comma seperated list of new alias names to the Target. |
org.w3c.dom.Element |
addAsLinkToXmlElement(org.w3c.dom.Element element)
Adds the target link to an given XML DOM Element The target element itself will be attached to given elements ownerDocument. |
abstract org.w3c.dom.Element |
addToXmlElement(org.w3c.dom.Element element)
Adds this Target to a given parent XML DOM Element. |
protected org.w3c.dom.Element |
createXmlTargetElement(org.w3c.dom.Element parent)
Creates an XML DOM Element for the Target. |
boolean |
equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object. |
boolean |
equalsID(java.lang.Object o)
Returns true if the given object is an instance of ITarget and the given objects SchmemaElement.getID() returns the same string as this objects getID() method. |
java.lang.String[] |
getAliasNames()
Returns all alias names. |
java.lang.String |
getConstellation()
Returns the celestial constellation, where the target can be found. |
java.lang.String |
getDatasource()
Returns the datasource which is the origin of the target. |
java.lang.String |
getDisplayName()
Returns a display name for this element. |
java.lang.String |
getName()
Returns the name of the target. |
IObserver |
getObserver()
Returns the observer who is the originator of the target. |
EquPosition |
getPosition()
Returns the position of the target. |
boolean |
removeAliasName(java.lang.String aliasName)
Removes a alias name from the target. |
void |
setAliasNames(java.lang.String[] newAliasNames)
Sets an array of new alias names to this target. |
void |
setConstellation(java.lang.String constellation)
Sets the celestial constellation, where the target can be found. |
void |
setDatasource(java.lang.String datasource)
Sets the datasource of the target. |
void |
setName(java.lang.String name)
Sets the name of the target. |
void |
setObserver(IObserver observer)
Sets the observer who is the originator of the target. |
void |
setPosition(EquPosition position)
Sets the position of the target. |
| Methods inherited from class de.lehmannet.om.SchemaElement |
|---|
getID, setID |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.lehmannet.om.ISchemaElement |
|---|
getID |
| Methods inherited from interface de.lehmannet.om.IExtendableSchemaElement |
|---|
getXSIType |
| Constructor Detail |
|---|
protected Target(org.w3c.dom.Node targetElement,
IObserver[] observers)
throws SchemaException
observers - Array of IObserver that might be linked from this observation,
can be NULL if datasource element is settargetElement - The origin XML DOM SchemaException - if given targetElement was null
protected Target(java.lang.String name,
java.lang.String datasource)
throws java.lang.IllegalArgumentException
name - The name of the astronomical objectdatasource - The datasource which is the origin of the
astronomical object
java.lang.IllegalArgumentException - if name or datasource
was null
protected Target(java.lang.String name,
IObserver observer)
throws java.lang.IllegalArgumentException
name - The name of the astronomical objectobserver - The observer which is the originator of the
astronomical object
java.lang.IllegalArgumentException - if name or observer
was null| Method Detail |
|---|
public java.lang.String getDisplayName()
getDisplayName in interface ISchemaElementgetDisplayName in class SchemaElementjava.lang.Object.toString();public boolean equals(java.lang.Object obj)
equals in class SchemaElementobj - The Object to compare this Target with.
true if the given Object is an instance of ITarget,
both XSI types are equal, the datasource or observer is equal
and its name is equal to this Target name.Objectpublic boolean equalsID(java.lang.Object o)
equalsID in interface ITargetpublic abstract org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
addToXmlElement in interface ITargetparent - The parent element for this Target
null if parent was null.Elementpublic org.w3c.dom.Element addAsLinkToXmlElement(org.w3c.dom.Element element)
addAsLinkToXmlElement in interface ITargetparent - The element under which the the target link is created
null if element was null.Elementpublic boolean addAliasName(java.lang.String newAliasName)
addAliasName in interface ITargetnewAliasName - A new alias name
true if the alias name could be added.
If false is returned the new alias was null
or an empty String.public void setAliasNames(java.lang.String[] newAliasNames)
null is passed, the given alias names are deleted.
setAliasNames in interface ITargetnewAliasNames - An arry with new alias namepublic java.lang.String[] getAliasNames()
getAliasNames in interface ITargetnull
is returned.public boolean removeAliasName(java.lang.String aliasName)
removeAliasName in interface ITargetaliasName - The alias name that should be removed
true if the alias name
could be removed from the target. If false
is returned the given alias name could not be found
in the targets alias name list or the parameter was
null or contained a empty string.public java.lang.String getName()
getName in interface ITargetpublic java.lang.String getConstellation()
NULL if constellation was never set
getConstellation in interface ITargetpublic void setConstellation(java.lang.String constellation)
setConstellation in interface ITargetconstellation - The celestial constellation of the target
public void setName(java.lang.String name)
throws java.lang.IllegalArgumentException
setName in interface ITargetjava.lang.IllegalArgumentException - if name was nullpublic EquPosition getPosition()
getPosition in interface ITargetnull if position was never set.public IObserver getObserver()
getObserver in interface ITargetnull if observer was never set. (In this
case a dataSource must exist)public java.lang.String getDatasource()
getDatasource in interface ITargetnull if datasource was never set. (In this
case a observer must exist)public void setPosition(EquPosition position)
setPosition in interface ITargetposition - The position of the astronomical object
in a popular coordination systempublic void setDatasource(java.lang.String datasource)
setDatasource in interface ITargetdatasource - The datasource of the astronomical objectpublic void setObserver(IObserver observer)
setObserver in interface ITargetobserver - The observer who is the originator of this targetprotected org.w3c.dom.Element createXmlTargetElement(org.w3c.dom.Element parent)
parent - The target container element
null if parent was null.Elementpublic boolean addAliasNames(java.lang.String aliasNames)
aliasNames - Comma seperated list with alternative names
of the astronomical object
true if all alias names of the list
could be added.
If false is returned the new alias was null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||