|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.model.source.SourceVelocity
public class SourceVelocity
The velocity of an astronomical source.
Version Info:
$Revision: 1710 $ |
$Date: 2008-11-14 11:54:07 -0700 (Fri, 14 Nov 2008) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
SourceVelocity()
Creates a new instance. |
Method Summary | |
---|---|
Frequency |
calcShiftedFrequency(Frequency restFreq)
Returns an observed frequency based on a rest frequency and the convention and magnitude of this source velocity. |
SourceVelocity |
clone()
Returns a source velocity that is equal to this one. |
int |
compareTo(SourceVelocity other)
Compares this velocity to other for order. |
boolean |
equals(Object o)
Returns true if o is equal to this source velocity. |
VelocityConvention |
getConvention()
Returns the convention used for this velocity. |
LinearVelocity |
getRadialVelocity()
Returns the speed of this source velocity. |
VelocityFrame |
getRestFrame()
Returns the frame of rest used for this velocity. |
FrequencyRange |
getValidFrequency()
Returns the frequency range for which this source velocity is valid. |
int |
hashCode()
Returns a hash code value for this source velocity. |
void |
reset()
Returns this velocity to its initial state. |
void |
setConvention(VelocityConvention newConvention)
Sets the convention used for this velocity. |
void |
setRadialVelocity(LinearVelocity newSpeed)
Sets the speed of this source velocity. |
void |
setRestFrame(VelocityFrame restFrame)
Sets the frame of rest used for this velocity. |
void |
setValidFrequency(FrequencyRange newRange)
Sets the valid frequency range for this source velocity, assuming the source is at rest. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SourceVelocity()
Method Detail |
---|
public void reset()
public void setConvention(VelocityConvention newConvention)
If newConvention
is null, it will be treated as
a non-null default type.
newConvention
- the measurement convention used by this velocity.public VelocityConvention getConvention()
public void setRestFrame(VelocityFrame restFrame)
restFrame
- the frame of rest used for this velocity.public VelocityFrame getRestFrame()
public void setRadialVelocity(LinearVelocity newSpeed)
newSpeed
will be referenced internally by this object,
so any changes made to it after this call will be reflected herein.
If newSpeed
is null, this velocity's speed will be set
to zero, with the units set according to the current
convention
.
newSpeed
- the new radial velocity for this source velocity.public LinearVelocity getRadialVelocity()
The return value is guaranteed to be non-null. It is also the speed that is held internally by this source velocity, so any changes made to the returned speed will be reflected in this object.
public void setValidFrequency(FrequencyRange newRange)
If newRange
is null, this velocity's frequency
range will be set to all (positive) frequencies.
newRange
- the frequency range for this source velocity.public FrequencyRange getValidFrequency()
The return value is guaranteed to be non-null. It is also the range that is held internally by this source velocity, so any changes made to the returned range will be reflected in this object.
public Frequency calcShiftedFrequency(Frequency restFreq)
restFreq
- a rest frequency that is to be transformed to
another value based on this velocity.
restFreq
and this velocity.public String toString()
toString
in class Object
public SourceVelocity clone()
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in class Object
public boolean equals(Object o)
o
is equal to this source velocity.
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(SourceVelocity other)
other
for order.
One velocity is deemed to be "less than" the other if it has a valid frequency range that is less than that of the other. In the case that two velocities have the same valid frequency range, the rest frame is used as a tie-breaker. If these are the same the velocity value, in km/s, is compared next. If no differences are found, the return value is zero.
compareTo
in interface Comparable<SourceVelocity>
other
- the velocity to which this one is compared.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |