|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.measure.AngularVelocity
public class AngularVelocity
A measure of angular velocity.
Version Info:
$Revision: 1816 $ |
$Date: 2008-12-23 10:21:00 -0700 (Tue, 23 Dec 2008) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
AngularVelocity()
Creates a new angular velocity of zero milliarcseconds per year. |
|
AngularVelocity(BigDecimal masPerYear)
Creates a new angular velocity of masPerYear milliarcseconds
per year. |
|
AngularVelocity(BigDecimal magnitude,
AngularVelocityUnits units)
Creates a new angular velocity with the given magnitude and units. |
|
AngularVelocity(String masPerYear)
Creates a new angular velocity of masPerYear milliarcseconds
per year. |
|
AngularVelocity(String magnitude,
AngularVelocityUnits units)
Creates a new angular velocity with the given magnitude and units. |
Method Summary | |
---|---|
AngularVelocity |
add(AngularVelocity other)
Adds other angular velocity to this one. |
AngularVelocity |
clone()
Returns a angular velocity that is equal to this one. |
int |
compareTo(AngularVelocity otherDist)
Compares this angular velocity with the otherDist for order. |
AngularVelocity |
convertTo(AngularVelocityUnits newUnits)
Converts this measure of angular velocity to the new units. |
boolean |
equals(Object o)
Returns true if o is equal to this angular velocity. |
AngularVelocityUnits |
getUnits()
Returns the units of this angular velocity. |
BigDecimal |
getValue()
Returns the magnitude of this angular velocity. |
int |
hashCode()
Returns a hash code value for this angular velocity. |
boolean |
isInDefaultState()
Returns true if this angular velocity is in its default state, no matter how it got there. |
boolean |
isInfinite()
Returns true if the magnitude of this frequency approaches infinity. |
static AngularVelocity |
parse(String velocityString)
Returns a new velocity based on velocityString . |
void |
reset()
Resets this angular velocity so that it is equal to an angular velocity created via the no-argument constructor. |
void |
set(BigDecimal value,
AngularVelocityUnits units)
Sets the magnitude and units of this angular velocity. |
void |
set(String velocityText)
Sets the value and units of this velocity based on velocityText . |
void |
set(String value,
AngularVelocityUnits units)
Sets the magnitude and units of this angular velocity. |
void |
setUnits(AngularVelocityUnits newUnits)
Sets the units of this angular velocity to newUnits . |
void |
setValue(BigDecimal newValue)
Sets the magnitude of this angular velocity to newValue . |
void |
setValue(String newValue)
Sets the magnitude of this angular velocity to newValue . |
AngularVelocity |
subtract(AngularVelocity other)
Subtracts other angular velocity from this one. |
String |
toString()
Returns a text representation of this angular velocity. |
BigDecimal |
toUnits(AngularVelocityUnits otherUnits)
Returns the magnitude of this angular velocity in otherUnits . |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AngularVelocity()
public AngularVelocity(BigDecimal masPerYear)
masPerYear
milliarcseconds
per year.
public AngularVelocity(String masPerYear)
masPerYear
milliarcseconds
per year.
public AngularVelocity(BigDecimal magnitude, AngularVelocityUnits units)
public AngularVelocity(String magnitude, AngularVelocityUnits units)
Method Detail |
---|
public void reset()
public BigDecimal getValue()
public AngularVelocityUnits getUnits()
public void set(String velocityText)
velocityText
.
See parse(String)
for the expected format of
velocityText
.
If the parsing fails, this velocity will be kept in its current state.
velocityText
- a string that will be converted into a velocity.
IllegalArgumentException
- if velocityText
is not in the expected form.public final void set(BigDecimal value, AngularVelocityUnits units)
value
- the new magnitude for this angular velocity.units
- the new units for this angular velocity.public final void set(String value, AngularVelocityUnits units)
value
- the new magnitude for this angular velocity.units
- the new units for this angular velocity.public final void setValue(BigDecimal newValue)
newValue
.
Note that the units of this angular velocity are unaffected by this method.
newValue
- the new magnitude for this angular velocity.public final void setValue(String newValue)
newValue
.
Note that the units of this angular velocity are unaffected by this method.
newValue
- the new magnitude for this angular velocity.
NumberFormatException
- if newValue
is null.public final void setUnits(AngularVelocityUnits newUnits)
newUnits
.
Note that the value of this angular velocity is unaffected by
this method.
Contrast this with convertTo(AngularVelocityUnits)
.
newUnits
- the new units for this angular velocity.
If newUnits
is null it will be replaced
with a non-null default type.public boolean isInDefaultState()
An angular velocity is in its default state if both its value and
its units are the same as those of an angular velocity newly created via
the no-argument constructor
.
An angular velocity whose most recent update came via the
reset
method is also in its default state.
public boolean isInfinite()
public AngularVelocity convertTo(AngularVelocityUnits newUnits)
After this method is complete this angular velocity will have units of
newUnits
and its value will have been converted
accordingly.
newUnits
- the new units for this angular velocity.
If newUnits
is null an
IllegalArgumentException
will be thrown.
double kilometers =
myAngularVelocity.convertTo(AngularVelocityUnits.KILOMETERS).getValue();
public BigDecimal toUnits(AngularVelocityUnits otherUnits)
otherUnits
.
Note that this method does not alter the state of this angular velocity.
Contrast this with convertTo(AngularVelocityUnits)
.
otherUnits
- the units in which to express this angular velocity's magnitude.
otherUnits
.
IllegalArgumentException
- if otherUnits
is null.public AngularVelocity add(AngularVelocity other)
other
angular velocity to this one.
other
- the angular velocity to be added to this angular velocity.
public AngularVelocity subtract(AngularVelocity other)
other
angular velocity from this one.
other
- the angular velocity to be subtracted from this angular velocity.
public static AngularVelocity parse(String velocityString)
velocityString
.
Valid Formats
Let R be the text representation of a real number.
Let w represent zero or more whitespace characters.
Let S be a valid units
symbol.
Format One: wRw. The given number will be defined to be
in units of mas/yr
.
Format Two: wRwSw.
If velocityString
is null or the empty string (""),
the returned velocity will be equal to one created via the no-argument
constructor.
velocityString
- a string that will be converted into a velocity.
IllegalArgumentException
- if velocityString
is not in
the expected form.public String toString()
toString
in class Object
public AngularVelocity clone()
clone
in class Object
public boolean equals(Object o)
o
is equal to this angular velocity.
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(AngularVelocity otherDist)
otherDist
for order.
compareTo
in interface Comparable<AngularVelocity>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |