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

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.FocusScan
All Implemented Interfaces:
UserAccountable, Identifiable, Cloneable

public class FocusScan
extends Scan

A scan that holds a list of focus offsets.

Version Info:

$Revision: 1314 $
$Date: 2008-05-30 11:31:14 -0600 (Fri, 30 May 2008) $
$Author: dharland $

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
 void addOffsets(Distance minimumOffset, Distance maximumOffset, int numberOfOffsets, TimeDuration timeAtOffset)
          Adds a series of offsets to this scan's list.
 void addOffsets(int numberOfPositiveOffsets, Distance incrementalOffset, TimeDuration timeAtOffset)
          Adds a series of offsets to this scan's list.
 FocusScan clone()
          Returns a focus scan that is a copy of this one.
 boolean equals(Object o)
          Returns true if o is equal to this focus scan.
 List<FocusOffset> getOffsets()
          Returns the list of focus offsets held by this scan.
 int hashCode()
          Returns a hash code value for this scan loop element.
 void setOffsets(List<FocusOffset> replacementList)
          Sets the list of focus offsets held by this scan.
 List<FocusOffset> sortOffsets()
          Sorts the internal list of offsets and returns it.
 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

setOffsets

public void setOffsets(List<FocusOffset> replacementList)
Sets the list of focus offsets 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 focus offsets to be held by this scan.

getOffsets

public List<FocusOffset> getOffsets()
Returns the list of focus offsets 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 focus offsets held by this scan.

sortOffsets

public List<FocusOffset> sortOffsets()
Sorts the internal list of offsets and returns it.

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 focus offsets held by this scan after, they have been sorted.

addOffsets

public void addOffsets(int numberOfPositiveOffsets,
                       Distance incrementalOffset,
                       TimeDuration timeAtOffset)
Adds a series of offsets to this scan's list. The number of new offsets added is equal to 1 + 2 * numberOfPositiveOffsets. If we call the numberOfPositiveOffsets "n" and the incrementalOffset "d", offsets of the following lengths will be added to this scan:

  -nd,...,-2d,-d,0,+d,+2d,...,+nd.

Parameters:
numberOfPositiveOffsets - the number of positive offsets to be added. The total number of offsets added is equal to one plus two times this amount. An IllegalArgumentException will be thrown if this value is negative.
incrementalOffset - the spacing between the offsets added by this method. This value is typically in millimeters. An IllegalArgumentException will be thrown if this value less than or equal to zero.
timeAtOffset - the amount of time the focus should be placed at this offset.
Throws:
IllegalArgumentException - if any of the parameters violate the rules listed above.

addOffsets

public void addOffsets(Distance minimumOffset,
                       Distance maximumOffset,
                       int numberOfOffsets,
                       TimeDuration timeAtOffset)
Adds a series of offsets to this scan's list. The number of new offsets added is numberOfOffsets. The smallest new offset is minimumOffset, the largest is maximumOffset. The other offsets are spread evenly between these two endpoints.

Parameters:
minimumOffset - the smallest focus offset. This value is often negative.
maximumOffset - the largest focus offset. An IllegalArgumentException will be thrown if this value is less than or equal to the minimumOffset.
numberOfOffsets - the number of new offsets to be added. Special cases:
  • numberOfOffsets < 1: No new offsets will be added.
  • numberOfOffsets == 1: Only the minimumOffset will be added.
  • numberOfOffsets == 2: Only the minimumOffset and maximumOffset will be added.
timeAtOffset - the amount of time the focus should be placed at this offset.
Throws:
IllegalArgumentException - if any of the parameters violate the rules listed above.

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 FocusScan clone()
Returns a focus 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 focus scan.

In order for o to be equal to this scan, it must have equal focus offsets 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.