edu.nrao.sss.model.source.sort
Class SourceLatitudeSortKey

java.lang.Object
  extended by edu.nrao.sss.model.source.sort.SourceLatitudeSortKey
All Implemented Interfaces:
Orderable, Comparator<SourceCatalogEntry>

public class SourceLatitudeSortKey
extends Object

Sorts sources based on the latitude of the position of their central subsources.

The default values for this key's attributes are:

Version Info:

$Revision: 616 $
$Date: 2007-05-16 14:22:53 -0600 (Wed, 16 May 2007) $
$Author: dharland $

Since:
2007-05-08
Author:
David M. Harland

Field Summary
static Date NOW
          Tells this key to get position information as of the current system time.
 
Constructor Summary
SourceLatitudeSortKey()
           
 
Method Summary
 int compare(SourceCatalogEntry sce1, SourceCatalogEntry sce2)
           
 SortOrder getOrder()
           
 void setConversionParameters(CelestialCoordinateSystem coordSys, Epoch epoch)
          Sets the coordinate system and epoch to which a source's position will be converted prior to comparisons.
 void setObserverParameters(EarthPosition location, TimeZone timeZone)
          Sets the earth position and time zone to be used in coordinate conversions.
 void setOrder(SortOrder newOrder)
           
 void setQueryTime(Date newTime)
          Sets the time for which position information will be requested.
 void turnOffConversion()
          Configures this key so that positions are compared without conversion to a common coordinate system and epoch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

NOW

public static final Date NOW
Tells this key to get position information as of the current system time.

Constructor Detail

SourceLatitudeSortKey

public SourceLatitudeSortKey()
Method Detail

setConversionParameters

public void setConversionParameters(CelestialCoordinateSystem coordSys,
                                    Epoch epoch)
Sets the coordinate system and epoch to which a source's position will be converted prior to comparisons. Calling this method turns conversion on. To turn it off, use turnOffConversion().

Parameters:
coordSys - the coordinate system to which all sources' positions will be converted prior to comparison.
epoch - the epoch to which all sources' positions will be converted prior to comparison.
Throws:
IllegalArgumentException - if either parameter is null.

turnOffConversion

public void turnOffConversion()
Configures this key so that positions are compared without conversion to a common coordinate system and epoch. This means that the raw latitudes or longitudes will be compared directly. The only time this is a safe thing to do is when you know that all the sources have positions expressed in the same system and epoch.

To turn conversion back on, specify the coordinate system and epoch via the setConversionParameters(CelestialCoordinateSystem, Epoch) method.


setObserverParameters

public void setObserverParameters(EarthPosition location,
                                  TimeZone timeZone)
Sets the earth position and time zone to be used in coordinate conversions. This method is rarely used. The observer's parameters come into play only when dealing with conversions to or from AZ/EL. The default position and time zone are those of the EVLA.

Parameters:
location - the location of the observer to be used in coordinate conversion calculations. A value of null will result in the use of the EVLA's position.
timeZone - the time zone of the observer to be used in coordinate conversion calculations. A value of null will result in the use of the EVLA's position.
Since:
2008-10-08

setQueryTime

public void setQueryTime(Date newTime)
Sets the time for which position information will be requested. The constant NOW may be used as a signal to use the current system time. If you use the NOW signal, this class will try to ensure that all comparisons in a single sort use the same time, and that the time is updated at the start of a new sort.

Parameters:
newTime - the time at which position information will be evaluated.

setOrder

public void setOrder(SortOrder newOrder)
Specified by:
setOrder in interface Orderable

getOrder

public SortOrder getOrder()
Specified by:
getOrder in interface Orderable

compare

public int compare(SourceCatalogEntry sce1,
                   SourceCatalogEntry sce2)
Specified by:
compare in interface Comparator<SourceCatalogEntry>


Copyright © 2009. All Rights Reserved.