net.grelf.astro
Class Magnitude

java.lang.Object
  extended by net.grelf.astro.Magnitude
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Magnitude
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Type representing astronomical magnitude. NB: If a star's magnitude is unknown that fact is represented by having a null magnitude. There is no Magnitude object having unknown value. Designed in such a way that band ids can be ignored if desired. A band id can be any string of text but the conventional single-character identifiers (I, B, V, R, etc) may be used.

9.12.20: Modified to add the bandId field and 2nd constructor using it; also added toXML ().

See Also:
Serialized Form

Constructor Summary
Magnitude(float value)
          Unknown band - bandId set to empty string.
Magnitude(float value, java.lang.String bandId)
          Band identifier is typically a single letter: U, B, V, R or I.
 
Method Summary
 Magnitude clone()
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getBandId()
          Get band identifier, typically a single letter: U, B, V, R or I.
 float getValue()
           
 int hashCode()
          Enable objects of this class to be used as hash keys.
 java.lang.String toString()
           
 java.lang.StringBuffer toXML()
          Creates a element, either containing a simple value (if the band id is empty) or 2 sub-elements: and .
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Magnitude

public Magnitude(float value)
Unknown band - bandId set to empty string.


Magnitude

public Magnitude(float value,
                 java.lang.String bandId)
Band identifier is typically a single letter: U, B, V, R or I.

Method Detail

getValue

public float getValue()

getBandId

public java.lang.String getBandId()
Get band identifier, typically a single letter: U, B, V, R or I.


equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Enable objects of this class to be used as hash keys.

Overrides:
hashCode in class java.lang.Object

clone

public Magnitude clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXML

public java.lang.StringBuffer toXML()
Creates a element, either containing a simple value (if the band id is empty) or 2 sub-elements: and .