org.jscience.ml.om
Interface IObserver

All Superinterfaces:
ISchemaElement
All Known Implementing Classes:
Observer

public interface IObserver
extends ISchemaElement

An IObserver describes person, who does astronomical observations.
The IObserver interface provides access to at least the name and surname of the person. Additionally address informations may be stored here.

Since:
1.0

Field Summary
static java.lang.String XML_ELEMENT_CONTACT
          Constant for XML representation: Observers contact element name.
static java.lang.String XML_ELEMENT_DSL
          Constant for XML representation: Observers DeepSkyList (DSL) code.
static java.lang.String XML_ELEMENT_NAME
          Constant for XML representation: Observers name element name.
static java.lang.String XML_ELEMENT_OBSERVER
          Constant for XML representation: IObserver element name.
static java.lang.String XML_ELEMENT_SURNAME
          Constant for XML representation: Observers surname element name.
 
Fields inherited from interface org.jscience.ml.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Method Summary
 org.w3c.dom.Element addAsLinkToXmlElement(org.w3c.dom.Element parent, java.lang.String NameOfLinkElement)
          Adds a Observer link to an given XML DOM Element.
 boolean addContact(java.lang.String newContact)
          Adds a new contact information to the observer.
 org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
          Adds this Observer to a given parent XML DOM Element.
 java.util.List getContacts()
          Returns a List with contact information of the observer
The returned List may contain e-Mail address, phone number, fax number, postal adress, webpage....whatever.
 java.lang.String getDSLCode()
          Returns the DeepSkyList (DSL) Code of the observer
Might return NULL if observer has no DSL code
 java.lang.String getName()
          Returns the name of the observer
The name (and the surname) are the only mandatory fields this interface requires.
 java.lang.String getSurname()
          Returns the surname of the observer
The surname (and the name) are the only mandatory fields this interface requires.
 boolean setContacts(java.util.List newContacts)
          Sets the contact information to the observer.
 void setDSLCode(java.lang.String DSLCode)
          Sets the DeepSkyList (DSL) Code of the observer
 void setName(java.lang.String name)
          Sets a new name to the observer.
 void setSurname(java.lang.String surname)
          Sets a new surname to the observer.
 
Methods inherited from interface org.jscience.ml.om.ISchemaElement
getDisplayName, getID
 

Field Detail

XML_ELEMENT_OBSERVER

static final java.lang.String XML_ELEMENT_OBSERVER
Constant for XML representation: IObserver element name.
Example:
<observer>More stuff goes here</observer>

See Also:
Constant Field Values

XML_ELEMENT_NAME

static final java.lang.String XML_ELEMENT_NAME
Constant for XML representation: Observers name element name.
Example:
<observer>
More stuff goes here <name>Observer name goes here</name> More stuff goes here </observer>

See Also:
Constant Field Values

XML_ELEMENT_SURNAME

static final java.lang.String XML_ELEMENT_SURNAME
Constant for XML representation: Observers surname element name.
Example:
<observer>
More stuff goes here <surname>Observer surname goes here</surname> More stuff goes here </observer>

See Also:
Constant Field Values

XML_ELEMENT_CONTACT

static final java.lang.String XML_ELEMENT_CONTACT
Constant for XML representation: Observers contact element name.
Example:
<observer>
More stuff goes here <contact>Observer name goes here</contact> More stuff goes here </observer>

See Also:
Constant Field Values

XML_ELEMENT_DSL

static final java.lang.String XML_ELEMENT_DSL
Constant for XML representation: Observers DeepSkyList (DSL) code.
Example:
<observer>
More stuff goes here <DSL>Observer DSL code goes here</DSL> More stuff goes here </observer>

See Also:
Constant Field Values
Method Detail

addToXmlElement

org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
Adds this Observer to a given parent XML DOM Element. The Observer element will be set as a child element of the passed element.

Parameters:
parent - The parent element for this Observer
Returns:
Returns the element given as parameter with this Observer as child element.
Might return null if parent was null.
See Also:
Element

addAsLinkToXmlElement

org.w3c.dom.Element addAsLinkToXmlElement(org.w3c.dom.Element parent,
                                          java.lang.String NameOfLinkElement)
Adds a Observer link to an given XML DOM Element. The Observer element itself will be attached to given elements ownerDocument. If the ownerDocument has no observer container, it will be created.
It might look a little odd that observers addAsLinkToXmlElement() method takes two parameters, but it is nessary as IObserver is once used as (under ) and used as under other elements. This is why the name of the link element has to be specified. The link element will be created under the passed parameter element. Example:
<parameterElement>
<linkNameElement>123</linkNameElement>
</parameterElement>
More stuff of the xml document goes here
<observerContainer>
<observer id="123">
Observer description goes here
</observer>
</observerContainer>

Parameters:
parent - The element at which the Observer link will be created.
NameOfLinkElement - The name of the link element, which is set under the passed element
Returns:
Returns the Element given as parameter with the Observer as linked child element, and the elements ownerDocument with the additional Observer element Might return null if element was null.
See Also:
Element

getContacts

java.util.List getContacts()
Returns a List with contact information of the observer
The returned List may contain e-Mail address, phone number, fax number, postal adress, webpage....whatever. No garantee is given what the list should/may contain, or in which order the elements are placed.
If no contact informations where given, the method might return null

Returns:
a List with contact information of the observer, or null if not informations are given.

getName

java.lang.String getName()
Returns the name of the observer
The name (and the surname) are the only mandatory fields this interface requires.

Returns:
the name of the observer

getSurname

java.lang.String getSurname()
Returns the surname of the observer
The surname (and the name) are the only mandatory fields this interface requires.

Returns:
the surname of the observer

getDSLCode

java.lang.String getDSLCode()
Returns the DeepSkyList (DSL) Code of the observer
Might return NULL if observer has no DSL code

Returns:
the DeepSkyList (DSL) Code of the observer, or NULL if DSL was never set

addContact

boolean addContact(java.lang.String newContact)
Adds a new contact information to the observer.

Parameters:
newContact - the additional contact information
Returns:
true if the new contact information could be added successfully. false if the new contact information could not be added.

setContacts

boolean setContacts(java.util.List newContacts)
Sets the contact information to the observer.
All current contacts will be deleted!
If you want to add a contact use addContact(String)

Parameters:
newContacts - new list of contact informations
Returns:
true if the new contact information could be set successfully. false if the new contact information could not be set.

setDSLCode

void setDSLCode(java.lang.String DSLCode)
Sets the DeepSkyList (DSL) Code of the observer

Parameters:
DSLCode - the DeepSkyList (DSL) Code of the observer

setName

void setName(java.lang.String name)
             throws java.lang.IllegalArgumentException
Sets a new name to the observer.
As the name is mandatory it cannot be null

Parameters:
name - the new name of the observer
Throws:
java.lang.IllegalArgumentException - if the given name is null

setSurname

void setSurname(java.lang.String surname)
                throws java.lang.IllegalArgumentException
Sets a new surname to the observer.
As the surname is mandatory it cannot be null

Parameters:
surname - the new surname of the observer
Throws:
java.lang.IllegalArgumentException - if the given surname is null