|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.model.project.scan.ScanTimeSpecification
public class ScanTimeSpecification
Specification for the timing of a Scan
.
Version Info:
$Revision: 1709 $ |
$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $ |
$Author: dharland $ (last person to modify) |
Constructor Summary | |
---|---|
ScanTimeSpecification()
Creates a new time specification. |
Method Summary | |
---|---|
ScanTimeSpecification |
clone()
Returns a copy of this specification. |
boolean |
equals(Object o)
Returns true if o is equal to this specification. |
TimeDuration |
getDuration()
Returns the specified duration, provided the type of this specification is a duration. |
TimeOfDay |
getLst()
Returns the specified local sidereal time of day, provided the type of this specification is an LST. |
Date |
getTime()
Returns the specified UT date and time, provided the type of this specification is a UT point in time. |
String |
getTimeText()
Returns a text representation of the duration or point in time held by this specification. |
ScanTimeType |
getTimeType()
Returns the type of time held by this specification. |
int |
hashCode()
Returns a hash code value for this specification. |
boolean |
isLengthOfTime()
Returns true if this specification is a duration (as opposed to a point in time). |
boolean |
isOnSourceDuration()
Returns true if this specification is a time-on-source duration. |
boolean |
isPointInTime()
Returns true if this specification is a point in time (as opposed to a duration). |
boolean |
isSiderealTime()
Returns true if this specification is expressed in sidereal units. |
boolean |
isStartTime()
Returns true if this specification is a start time. |
boolean |
isStopTime()
Returns true if this specification is a stop time. |
boolean |
isTotalDuration()
Returns true if this specification is a total duration. |
boolean |
isUniversalTime()
Returns true if this specification is expressed in SI units. |
void |
reset()
Returns this object to the same state as a newly created specification. |
void |
set(ScanTimeType newType,
Date newDateTime)
Specifies the universal date and time for a scan. |
void |
set(ScanTimeType newType,
LocalSiderealTime newLst)
Specifies the local sidereal time for a scan. |
void |
set(ScanTimeType newType,
String newTimeText)
Specifies the timing for a scan. |
void |
set(ScanTimeType newType,
TimeDuration newDuration)
Specifies the duration for a scan. |
void |
set(ScanTimeType newType,
TimeOfDay newLst)
Specifies the local sidereal time for a scan. |
String |
toString()
Returns a text representation of this specification. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ScanTimeSpecification()
Method Detail |
---|
public void reset()
public void set(ScanTimeType newType, String newTimeText)
The values of the two parameters must make sense together. If they
do not, an IllegalArgumentException
is thrown. These are the
rules for the parameters:
newType
is a duration, newTimeText
must conform
to the rules given by TimeDuration.parse(String)
.newType
is an LST, newTimeText
must conform
to the rules given by TimeOfDay.parse(String)
.newType
is a non-LST point in time, newTimeText
must be in the ISO 8601 form yyyy-MM-ddTHH:mm:ss.SSS+####,
where 'T' is the literal date/time separator. The parser is
very strict:
set(ScanTimeType, Date)
instead.
newType
- the kind of time that newTimeText
represents.newTimeText
- a text representation of a duration or point in time, depending
on the value of newType
.
IllegalArgumentException
- if the parameters do not make sense as a pair, or if newTimeText
cannot be parsed.set(ScanTimeType, Date)
,
set(ScanTimeType, LocalSiderealTime)
,
set(ScanTimeType, TimeDuration)
,
set(ScanTimeType, TimeOfDay)
public void set(ScanTimeType newType, TimeDuration newDuration)
newType
- must be a duration
type.
If it is not, an IllegalArgumentException
will be thrown.newDuration
- the new duration for this specification. May not be null.
IllegalArgumentException
- if newType
is not a duration or
if newDuration
is null.public void set(ScanTimeType newType, TimeOfDay newLst)
newType
- must be both a point-in-time
and
a sidereal time
.
If it is not, an IllegalArgumentException
will be thrown.
At this time this was written, the only legal values were:
ScanTimeType.START_LST
and ScanTimeType.STOP_LST
.newLst
- the new LST for this specification. May not be null.
IllegalArgumentException
- if the specifications above are not met.public void set(ScanTimeType newType, LocalSiderealTime newLst)
newType
- must be both a point-in-time
and
a sidereal time
.
If it is not, an IllegalArgumentException
will be thrown.
At this time this was written, the only legal values were:
ScanTimeType.START_LST
and ScanTimeType.STOP_LST
.newLst
- the new LST for this specification. May not be null.
The LocalSiderealTime
class is a date/time class, but
only the time-of-day portion of this parameter will be used here.
IllegalArgumentException
- if the specifications above are not met.public void set(ScanTimeType newType, Date newDateTime)
newType
- must be both a point-in-time
and
a universal time
.
If it is not, an IllegalArgumentException
will be thrown.
At this time this was written, the only legal values were:
ScanTimeType.START_UT
and ScanTimeType.STOP_UT
.newDateTime
- the new date and time for this specification. May not be null.
IllegalArgumentException
- if the specifications above are not met.public ScanTimeType getTimeType()
public String getTimeText()
public TimeDuration getDuration()
The type of duration returned can be determined by calling
getTimeType()
, or by using the isXxx
boolean methods.
The object returned is not the one held internally by this specification, so any changes made to it will not affect this specification.
public TimeOfDay getLst()
Whether the returned time is a start or stop time can be
determined by calling getTimeType()
, isStartTime()
, or
isStopTime()
.
The object returned is not the one held internally by this specification, so any changes made to it will not affect this specification.
public Date getTime()
Whether the returned time is a start or stop time can be
determined by calling getTimeType()
, isStartTime()
, or
isStopTime()
.
The object returned is not the one held internally by this specification, so any changes made to it will not affect this specification.
public boolean isLengthOfTime()
public boolean isPointInTime()
public boolean isOnSourceDuration()
public boolean isTotalDuration()
public boolean isStartTime()
public boolean isStopTime()
public boolean isUniversalTime()
public boolean isSiderealTime()
public String toString()
toString
in class Object
public ScanTimeSpecification 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 specification.
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |