edu.nrao.sss.model.project.scan
Class SwitchingScan

java.lang.Object
  extended by edu.nrao.sss.model.project.scan.ScanLoopElement
      extended by edu.nrao.sss.model.project.scan.Scan
          extended by edu.nrao.sss.model.project.scan.SwitchingScan
All Implemented Interfaces:
UserAccountable, Identifiable, Cloneable

public class SwitchingScan
extends Scan

A scan that holds a list of switch settings.

CVS Info:

$Revision: 161 $
$Date: 2006-12-15 11:48:34 -0700 (Fri, 15 Dec 2006) $
$Author: btruitt $

Since:
2006-07-10
Author:
David M. Harland

Field Summary
 
Fields inherited from class edu.nrao.sss.model.project.scan.Scan
DEFAULT_NAME
 
Fields inherited from interface edu.nrao.sss.util.Identifiable
UNIDENTIFIED
 
Fields inherited from interface edu.nrao.sss.model.UserAccountable
NULL_USER_ID
 
Method Summary
 SwitchingScan clone()
          Returns a switching scan that is a copy of this one.
 boolean equals(Object o)
          Returns true if o is equal to this switching scan.
 boolean getApplyAutoPhasing()
          Returns true if this scan should perform autophasing.
 Set<Source> getSources(Date dateTime)
          Returns the set of all sources used by this scan.
 List<SwitchSetting> getSwitchSettings()
          Returns the list of pointing positions held by this scan.
 TimeDuration getTimeOnTarget()
          Returns the amount of time that this scan should spend on the target source, as opposed to on a calibrator.
 int hashCode()
          Returns a hash code value for this scan loop element.
 void setApplyAutoPhasing(boolean apply)
          Indicates whether or not autophasing should be applied to this scan.
 void setSwitchSettings(List<SwitchSetting> replacementList)
          Sets the list of switch settings held by this scan.
 void setTimeOnTarget(TimeDuration duration)
          Sets the amount of time that this scan should spend on the target source, as opposed to on a calibrator.
 String toSummaryString()
          Returns a short textual description of this scan loop element.
 
Methods inherited from class edu.nrao.sss.model.project.scan.Scan
clearId, createFor, fromXml, fromXml, getAllowOverTheTop, getAntennaWrap, getApplyLastPhase, getApplyLastReferenceDelay, getApplyLastReferenceFocus, getApplyLastReferencePointing, getDopplerSpecs, getDopplerSpecs, getDopplerTracker, getIntents, getLongName, getMode, getReferenceAntennas, getResource, getShortName, getSolarObserving, getSource, getSource, getSourceCatalogEntry, getSubarray, getTimeSpec, getUseResourceOfPriorScan, removeDopplerSpecs, reset, setAllowOverTheTop, setAntennaWrap, setApplyLastPhase, setApplyLastReferenceDelay, setApplyLastReferenceFocus, setApplyLastReferencePointing, setDopplerSpecs, setIntents, setLongName, setResource, setShortName, setSolarObserving, setSourceCatalogEntry, setUseResourceOfPriorScan
 
Methods inherited from class edu.nrao.sss.model.project.scan.ScanLoopElement
appendComments, getComments, getCreatedBy, getCreatedOn, getId, getLastUpdatedBy, getLastUpdatedOn, getName, getProgramBlock, getProject, getSchedulingBlock, hasSchedulingBlock, setComments, setCreatedBy, setCreatedOn, setId, setLastUpdatedBy, setLastUpdatedOn, setName, setSchedulingBlock, toString, toXml, writeAsXmlTo
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setTimeOnTarget

public void setTimeOnTarget(TimeDuration duration)
Sets the amount of time that this scan should spend on the target source, as opposed to on a calibrator.

If duration is null, it will be treated as a non-null duration of size zero.

Parameters:
duration - the amount of time to be spent on the target source.

getTimeOnTarget

public TimeDuration getTimeOnTarget()
Returns the amount of time that this scan should spend on the target source, as opposed to on a calibrator.

The returned value is guaranteed to be non-null. It is also the duration that is held internally by this scan, so any changes made to the returned duration will be reflected in this object.

Returns:
the amount of time to be spent on the target source.

setApplyAutoPhasing

public void setApplyAutoPhasing(boolean apply)
Indicates whether or not autophasing should be applied to this scan.

Parameters:
apply - true if autophasing is desired.

getApplyAutoPhasing

public boolean getApplyAutoPhasing()
Returns true if this scan should perform autophasing.

Returns:
true if this scan should perform autophasing.

setSwitchSettings

public void setSwitchSettings(List<SwitchSetting> replacementList)
Sets the list of switch settings held by this scan. A null replacementList will be interpreted as a new empty list.

This scan will hold a reference to replacementList (unless it is null), so any changes made to the list after calling this method will be reflected in this object.

Parameters:
replacementList - a list of switch settings to be held by this scan.

getSwitchSettings

public List<SwitchSetting> getSwitchSettings()
Returns the list of pointing positions held by this scan. The returned list is guaranteed to be non-null, but may be empty.

The returned list is the actual list held by this scan, so changes made to the list will be reflected in this object.

Returns:
the list of pointing positions held by this scan.

getSources

public Set<Source> getSources(Date dateTime)
Returns the set of all sources used by this scan. This includes the main source and the source used in each of the switch settings.

Parameters:
dateTime - the time for which sources are requested.
Returns:
the set of all sources used by this scan.

toSummaryString

public String toSummaryString()
Description copied from class: ScanLoopElement
Returns a short textual description of this scan loop element.

Overrides:
toSummaryString in class Scan
Returns:
a short textual description of this scan loop element.

clone

public SwitchingScan clone()
Returns a switching scan that is a copy of this one.

The returned scan is, for the most part, a deep copy of this one. However, there are a few exceptions noted in the clone method of this class's parent.

If anything goes wrong during the cloning procedure, a RuntimeException will be thrown.

Overrides:
clone in class Scan

equals

public boolean equals(Object o)
Returns true if o is equal to this switching scan.

In order for o to be equal to this scan, it must have equal switch settings in the same order as those of this scan. It must also follow the rules set forth in the equals method of this class's parent.

Overrides:
equals in class Scan

hashCode

public int hashCode()
Description copied from class: ScanLoopElement
Returns a hash code value for this scan loop element.

Overrides:
hashCode in class Scan


Copyright © 2009. All Rights Reserved.