org.jscience.ml.om
Interface ISession

All Superinterfaces:
ISchemaElement
All Known Implementing Classes:
Session

public interface ISession
extends ISchemaElement

An ISession can be used to link several observations together. Typically a session would describe an observation night, where several observations took place. Therefore an ISession requires two mandatory fields: a start date and an end date. All observations of the session should have a start date that is inbetween the sessions start and end date.

Since:
1.0

Field Summary
static java.lang.String XML_ELEMENT_BEGIN
          Constant for XML representation: Sessions start date element name.
static java.lang.String XML_ELEMENT_COMMENTS
          Constant for XML representation: Sessions comments element name.
static java.lang.String XML_ELEMENT_COOBSERVER
          Constant for XML representation: Sessions coObserver element name.
static java.lang.String XML_ELEMENT_END
          Constant for XML representation: Sessions end date element name.
static java.lang.String XML_ELEMENT_EQUIPMENT
          Constant for XML representation: Sessions equipment element name.
static java.lang.String XML_ELEMENT_SESSION
          Constant for XML representation: Sessions element name.
static java.lang.String XML_ELEMENT_SITE
          Constant for XML representation: Sessions site element name.
static java.lang.String XML_ELEMENT_WEATHER
          Constant for XML representation: Sessions weather 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)
          Adds the session link to an given XML DOM Element The session element itself will be attached to given elements ownerDocument.
 boolean addCoObserver(IObserver coObserver)
          Adds a single coobserver to this session.
 boolean addCoObservers(java.util.List coObservers)
          Adds a List of coobservers to this session.
 org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
          Adds this Session to a given parent XML DOM Element.
 java.util.Calendar getBegin()
          Returns the start date of the session.
 java.lang.String getComments()
          Returns a comment about this session.
 java.util.List getCoObservers()
          Returns a List of coobservers who joined this session.
 java.util.Calendar getEnd()
          Returns the end date of the session.
 java.lang.String getEquipment()
          Returns a string describing equipment which was used during this session.
 ISite getSite()
          Returns the site of the session.
 java.lang.String getWeather()
          Returns a describtion of the weather conditions during the session.
 void setBegin(java.util.Calendar begin)
          Sets the start date of the session.
 void setComments(java.lang.String comments)
          Sets a comment to the session.
 boolean setCoObservers(java.util.List coObservers)
          Sets a new List of coobservers to this session.
 void setEnd(java.util.Calendar end)
          Sets the end date of the session.
 void setEquipment(java.lang.String equipment)
          Sets a equipment description to the session.
 void setSite(ISite site)
          Sets a site (location) where the session took place.
 void setWeather(java.lang.String weather)
          Sets the weather conditions of the session.
 
Methods inherited from interface org.jscience.ml.om.ISchemaElement
getDisplayName, getID
 

Field Detail

XML_ELEMENT_SESSION

static final java.lang.String XML_ELEMENT_SESSION
Constant for XML representation: Sessions element name.
Example:
<session>More stuff goes here</session>

See Also:
Constant Field Values

XML_ELEMENT_BEGIN

static final java.lang.String XML_ELEMENT_BEGIN
Constant for XML representation: Sessions start date element name.
Example:
<session>
More stuff goes here <begin>Sessions start date goes here</begin> More stuff goes here </session>

See Also:
Constant Field Values

XML_ELEMENT_END

static final java.lang.String XML_ELEMENT_END
Constant for XML representation: Sessions end date element name.
Example:
<session>
More stuff goes here <end>Sessions end date goes here</end> More stuff goes here </session>

See Also:
Constant Field Values

XML_ELEMENT_SITE

static final java.lang.String XML_ELEMENT_SITE
Constant for XML representation: Sessions site element name.
Example:
<session>
More stuff goes here <site>Sessions site goes here</site> More stuff goes here </session>

See Also:
Constant Field Values

XML_ELEMENT_COOBSERVER

static final java.lang.String XML_ELEMENT_COOBSERVER
Constant for XML representation: Sessions coObserver element name.
Example:
<session>
More stuff goes here <coObserver>Sessions coObserver goes here</coObserver> More stuff goes here </session>

See Also:
Constant Field Values

XML_ELEMENT_WEATHER

static final java.lang.String XML_ELEMENT_WEATHER
Constant for XML representation: Sessions weather element name.
Example:
<session>
More stuff goes here <weather>Sessions weather goes here</weather> More stuff goes here </session>

See Also:
Constant Field Values

XML_ELEMENT_EQUIPMENT

static final java.lang.String XML_ELEMENT_EQUIPMENT
Constant for XML representation: Sessions equipment element name.
Example:
<session>
More stuff goes here <equipment>Sessions equipment goes here</equipment> More stuff goes here </session>

See Also:
Constant Field Values

XML_ELEMENT_COMMENTS

static final java.lang.String XML_ELEMENT_COMMENTS
Constant for XML representation: Sessions comments element name.
Example:
<session>
More stuff goes here <comments>Sessions comments go here</comments> More stuff goes here </session>

See Also:
Constant Field Values
Method Detail

addToXmlElement

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

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

addAsLinkToXmlElement

org.w3c.dom.Element addAsLinkToXmlElement(org.w3c.dom.Element parent)
Adds the session link to an given XML DOM Element The session element itself will be attached to given elements ownerDocument. If the ownerDocument has no session container, it will be created.
Example:
<parameterElement>
<sessionLink>123</sessionLink>
</parameterElement>
More stuff of the xml document goes here
<sessionContainer>
<session id="123">
session description goes here
</session>
</sessionContainer>

Parameters:
parent - The element under which the the Session link is created
Returns:
Returns the Element given as parameter with a additional Session link, and the session element under the session container of the ownerDocument Might return null if element was null.
See Also:
Element

getBegin

java.util.Calendar getBegin()
Returns the start date of the session.

Returns:
Returns the start date of the session

getCoObservers

java.util.List getCoObservers()
Returns a List of coobservers who joined this session.
Might return null if no coobservers were added to this session.

Returns:
Returns a List of coobserver or null if coobservers were never added.

getComments

java.lang.String getComments()
Returns a comment about this session.
Might return null if no comment was set to this session.

Returns:
Returns a comment about this session or null if no comment was set at all.

getEnd

java.util.Calendar getEnd()
Returns the end date of the session.

Returns:
Returns the end date of the session

getSite

ISite getSite()
Returns the site of the session.

Returns:
Returns the site of the session

getEquipment

java.lang.String getEquipment()
Returns a string describing equipment which was used during this session.
Typically one should add non optical equipment here like "Radio and a warm bottle of Tea."
Might return null if no equipment was set to this session.

Returns:
Returns string describing some equipment which was used during the session or null if no additional equipment was used at all.

getWeather

java.lang.String getWeather()
Returns a describtion of the weather conditions during the session.
Might return null if no weather conditions were addedt to this session.

Returns:
Returns a describtion of the weather conditions during the session or null if no weather conditions were added at all.

setBegin

void setBegin(java.util.Calendar begin)
              throws java.lang.IllegalArgumentException
Sets the start date of the session.

Parameters:
begin - The new start date of the session.
Throws:
java.lang.IllegalArgumentException - if new start date is null

setEnd

void setEnd(java.util.Calendar end)
            throws java.lang.IllegalArgumentException
Sets the end date of the session.

Parameters:
end - The new end date of the session.
Throws:
java.lang.IllegalArgumentException - if new end date is null

setSite

void setSite(ISite site)
             throws java.lang.IllegalArgumentException
Sets a site (location) where the session took place.
A session can only took place at one site.

Parameters:
site - The site where the session took place.
Throws:
java.lang.IllegalArgumentException - if site is null

setComments

void setComments(java.lang.String comments)
Sets a comment to the session.
The old comment will be overwritten.

Parameters:
comments - A new comment for the session

setEquipment

void setEquipment(java.lang.String equipment)
Sets a equipment description to the session.
Typically non optical equipment will should be stored here, e.g. "Red LED light and bottle of hot tea."
The old equipment will be overwritten.

Parameters:
equipment - The new equipment of the session

setCoObservers

boolean setCoObservers(java.util.List coObservers)
Sets a new List of coobservers to this session.
The old List of coobservers will be overwritten. If you want to add one ore more coobservers to the existing list use addCoObservers(java.util.List) or addCoObserver(IObserver) instead.

Parameters:
coObservers - The new List of coobservers of the session
Returns:
true if the list could be set successfully, false if the operation fails, because e.g. one of the lists elements does not implement the IObserver interface. If false is returned the existing list is not changed at all.

addCoObservers

boolean addCoObservers(java.util.List coObservers)
Adds a List of coobservers to this session.
The old List of coobservers will be extended by the new List of coobservers.

Parameters:
coObservers - A List of coobservers which will be added to the existing List of coobservers which is stored in the session
Returns:
true if the list could be added to the existing list, false if the operation fails, because e.g. one of the lists elements does not implement the IObserver interface. If false is returned the existing list is not changed at all.

addCoObserver

boolean addCoObserver(IObserver coObserver)
Adds a single coobserver to this session.

Parameters:
coObserver - A new coobserver who will be addded to the List of coobservers
Returns:
true if the new coobserver could be added, false if the operation fails, because e.g. the given IObserver is null

setWeather

void setWeather(java.lang.String weather)
Sets the weather conditions of the session.
The weather conditions string should explain in some short sentences, how the weather conditions were like during the session. E.g. "Small clouds at the first hour but then totally clear and cool, at about 4�C."

Parameters:
weather - A string describing the weather conditions during the session