org.jscience.ml.om.extension.deepsky
Class DeepSkyFinding

java.lang.Object
  extended by org.jscience.ml.om.SchemaElement
      extended by org.jscience.ml.om.Finding
          extended by org.jscience.ml.om.extension.deepsky.DeepSkyFinding
All Implemented Interfaces:
IExtendableSchemaElement, IFinding, ISchemaElement

public class DeepSkyFinding
extends Finding

DeepSkyFinding extends the org.jscience.ml.om.Finding class. Its specialised for DeepSky observations and their findings. A DeepSky object can be an astronomical object outside our solar system. The class is mostly oriented after the recommondations of the german "VdS - DeepSky" group (Homepage).
The field rating is based on a seven step scale recommended by "VDS - DeepSky" group. The scales value should be interpreted as the following table explains:

1 Simple conspicuous object in the eyepiece 2 Good viewable with direct vision 3 Viewable with direct vision 4 Viewable only with averted vision 5 Object can hardly be seen with averted vision 6 Object dubiously sighted 7 Object not sighted

Since:
1.0

Field Summary
static java.lang.String XML_ELEMENT_FINDING_ATTRIBUTE_MOTTLED
           
static java.lang.String XML_ELEMENT_FINDING_ATTRIBUTE_RESOLVED
           
static java.lang.String XML_ELEMENT_FINDING_ATTRIBUTE_STELLAR
           
static java.lang.String XML_ELEMENT_LARGEDIAMETER
           
static java.lang.String XML_ELEMENT_RATING
           
static java.lang.String XML_ELEMENT_SMALLDIAMETER
           
 
Fields inherited from interface org.jscience.ml.om.IFinding
XML_ELEMENT_DESCRIPTION, XML_ELEMENT_FINDING
 
Fields inherited from interface org.jscience.ml.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Fields inherited from interface org.jscience.ml.om.IExtendableSchemaElement
XML_XSI_TYPE
 
Constructor Summary
DeepSkyFinding(org.w3c.dom.Node findingElement)
           
DeepSkyFinding(java.lang.String description, int rating)
          Constructs a new instance of a DeepSkyFinding.
 
Method Summary
 org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element parent)
          Adds this DeepSkyFinding to an given parent XML DOM Element.
 boolean equals(java.lang.Object obj)
          Overwrittes equals(Object) method from java.lang.Object.
 java.lang.String getDisplayName()
          Returns a display name for this element.
 Angle getLargeDiameter()
          Returns the large visible diameter of the observed object.
 boolean getMottled()
          Returns the mottled value of this DeepSkyFinding.
 int getRating()
          Returns the rating of the observed object.
 boolean getResolved()
          Returns true if the observed object could be seen resolved during observation.
 Angle getSmallDiameter()
          Returns the small visible diameter of the observed object.
 boolean getStellar()
          Returns true if the observed object appeard stellar during observation.
 java.lang.String getXSIType()
          Returns the XML schema instance type of the implementation.
 boolean setLargeDiameter(Angle largeDiameter)
          Sets the large visible diameter of the observed object.
 void setMottled(java.lang.Boolean mottled)
          Sets the mottled value of this DeepSkyFinding.
 void setRating(int rating)
          Sets the rating of the observed object.
 void setResolved(java.lang.Boolean resolved)
          Sets the resolved value for this DeepSkyFinding.
 boolean setSmallDiameter(Angle smallDiameter)
          Sets the small visible diameter of the observed object.
 void setStellar(java.lang.Boolean stellar)
          Sets the stellar value for this DeepSkyFinding.
 java.lang.String toString()
          Overwrittes toString() method from java.lang.Object.
 
Methods inherited from class org.jscience.ml.om.Finding
createXmlFindingElement, getDescription, setDescription
 
Methods inherited from class org.jscience.ml.om.SchemaElement
getID, setID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jscience.ml.om.ISchemaElement
getID
 

Field Detail

XML_ELEMENT_FINDING_ATTRIBUTE_STELLAR

public static final java.lang.String XML_ELEMENT_FINDING_ATTRIBUTE_STELLAR
See Also:
Constant Field Values

XML_ELEMENT_FINDING_ATTRIBUTE_RESOLVED

public static final java.lang.String XML_ELEMENT_FINDING_ATTRIBUTE_RESOLVED
See Also:
Constant Field Values

XML_ELEMENT_FINDING_ATTRIBUTE_MOTTLED

public static final java.lang.String XML_ELEMENT_FINDING_ATTRIBUTE_MOTTLED
See Also:
Constant Field Values

XML_ELEMENT_SMALLDIAMETER

public static final java.lang.String XML_ELEMENT_SMALLDIAMETER
See Also:
Constant Field Values

XML_ELEMENT_LARGEDIAMETER

public static final java.lang.String XML_ELEMENT_LARGEDIAMETER
See Also:
Constant Field Values

XML_ELEMENT_RATING

public static final java.lang.String XML_ELEMENT_RATING
See Also:
Constant Field Values
Constructor Detail

DeepSkyFinding

public DeepSkyFinding(org.w3c.dom.Node findingElement)
               throws SchemaException
Throws:
SchemaException

DeepSkyFinding

public DeepSkyFinding(java.lang.String description,
                      int rating)
               throws java.lang.IllegalArgumentException
Constructs a new instance of a DeepSkyFinding.

Parameters:
description - The description of the finding
rating - The rating of the finding
Throws:
java.lang.IllegalArgumentException - if description was null or rating had a illegal value.
Method Detail

getDisplayName

public java.lang.String getDisplayName()
Returns a display name for this element.
The method differs from the toString() method as toString() shows more technical information about the element. Also the formating of toString() can spread over several lines.
This method returns a string (in one line) that can be used as displayname in e.g. a UI dropdown box.

Specified by:
getDisplayName in interface ISchemaElement
Specified by:
getDisplayName in class SchemaElement
Returns:
Returns a String with a one line display name
See Also:
java.lang.Object.toString();

toString

public java.lang.String toString()
Overwrittes toString() method from java.lang.Object.
Returns the field values of this DeepSkyFinding.

Overrides:
toString in class java.lang.Object
Returns:
This DeepSkyValue field values
See Also:
Object

equals

public boolean equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object.
Checks if this DeepSkyFinding and the given Object are equal. Two DeepSkyFindings are equal if both return the same string from their toString() method and their XSI type is equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare this DeepSkyFinding with.
Returns:
true if both Objects are instances from class DeepSkyFinding, both XSI types are equal and their fields contain the same values. (Can be checked with calling and comparing both objects toString() method)
See Also:
Object

getXSIType

public java.lang.String getXSIType()
Returns the XML schema instance type of the implementation.
Example:


Returns:
The xsi:type value of this implementation

addToXmlElement

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

Specified by:
addToXmlElement in interface IFinding
Specified by:
addToXmlElement in class Finding
Parameters:
parent - The parent element for this DeepSkyFinding
Returns:
Returns the Element given as parameter with this DeepSkyFinding as child Element.
Might return null if parent was null.
See Also:
Element

getLargeDiameter

public Angle getLargeDiameter()
Returns the large visible diameter of the observed object.

Returns:
The large visible diameter of the object as Angle.
Might return null if large diameter was never set.
See Also:
Angle

getMottled

public boolean getMottled()
                   throws java.lang.IllegalStateException
Returns the mottled value of this DeepSkyFinding.
A observed object is mottled when it can be seen with at least some structures.

Returns:
true if the observed object could be seen with structures
Throws:
java.lang.IllegalStateException - if mottled was not set by the user so the class cannot return true or false

getRating

public int getRating()
Returns the rating of the observed object.
The rating scale is described at VdS - DeepSky Group. A valid rating value is an integer between 1 and 7.

Returns:
The rating that was given to the DeepSkyFinding during observation

getResolved

public boolean getResolved()
                    throws java.lang.IllegalStateException
Returns true if the observed object could be seen resolved during observation.

Returns:
true if the observed object could be seen resolved
Throws:
java.lang.IllegalStateException - if resolved was not set by the user so the class cannot return true or false

getSmallDiameter

public Angle getSmallDiameter()
Returns the small visible diameter of the observed object.

Returns:
The small visible diameter of the object as Angle Might return null if large diameter was never set.
See Also:
Angle

getStellar

public boolean getStellar()
                   throws java.lang.IllegalStateException
Returns true if the observed object appeard stellar during observation.

Returns:
true if the observed object appeard stellar
Throws:
java.lang.IllegalStateException - if stellar was not set by the user, so the class cannot return true or false

setLargeDiameter

public boolean setLargeDiameter(Angle largeDiameter)
Sets the large visible diameter of the observed object. The passed Angle needs to have a positiv value. If the Angles value is negativ, the large diameter will not be set and the method returns false.

Parameters:
largeDiameter - The large diameters (positiv) angle
Returns:
true if the angle was set successfully. If false is returned the angles value might have been nagativ or the Angle object was null. If false is returned the large diameter isn't set
See Also:
Angle

setMottled

public void setMottled(java.lang.Boolean mottled)
Sets the mottled value of this DeepSkyFinding.
A observed object is mottled when it can be seen with at least some structures.

Parameters:
mottled - The mottled value to set for this DeepSkyFinding or NULL if the value should be not set at all.

setRating

public void setRating(int rating)
               throws java.lang.IllegalArgumentException
Sets the rating of the observed object.
The rating scale is described at VdS - DeepSky Group A valid rating value is an integer between 1 and 7 (including 1 and 7). If any other value is passed to the method throws an IllegalArgumentException. Explaination of rating scale:
1 Simple conspicuous object in the eyepiece 2 Good viewable with direct vision 3 Viewable with direct vision 4 Viewable only with averted vision 5 Object can hardly be seen with averted vision 6 Object dubiously sighted 7 Object not sighted

Parameters:
rating - The rating value to set for this DeepSkyFinding. A valid rating value is an integer between 1 and 7
Throws:
java.lang.IllegalArgumentException - if rating > 7 or < 1

setResolved

public void setResolved(java.lang.Boolean resolved)
Sets the resolved value for this DeepSkyFinding.
The value should be true if the observed object could be seen resolved during observation.

Parameters:
resolved - The resolved value for this DeepSkyFinding or NULL if the value should be not set at all.

setSmallDiameter

public boolean setSmallDiameter(Angle smallDiameter)
Sets the small visible diameter of the observed object. The passed Angle needs to have a positiv value. If the Angles value is negativ, the small diameter will not be set and the method returns false.

Parameters:
smallDiameter - The small diameters (positiv) angle
Returns:
true if the angle was set successfully. If false is returned the angles value might have been nagativ or the Angle object was null. If false is returned the small diameter isn't set
See Also:
Angle

setStellar

public void setStellar(java.lang.Boolean stellar)
Sets the stellar value for this DeepSkyFinding.
The value should be true if the observed object could only be seen stellar during observation.

Parameters:
stellar - The stellar value to set for this DeepkSkyFinding or NULL if the value should be not set at all.