|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.astronomy.SkyPositionFilter
public class SkyPositionFilter
A filter that operates on SkyPosition
s.
This filter allows you to select positions based on their latitudes,
longitudes, and distances from some origin. In addition, this
filter has special setCone
methods that can be used separately or in conjunction with the
typical min/max ranges available for latitude and longitude.
That is, you could select only those positions that were both
in a given cone search and within given min/max latitude/longitude
values.
Revision Info:
$Revision: 1239 $ |
$Date: 2008-04-25 10:34:57 -0600 (Fri, 25 Apr 2008) $ |
$Author: dharland $ (last person to modify) |
Field Summary | |
---|---|
static Distance |
ANY_DISTANCE
A constant that may be used to indicate that the minimum or maximum distance is unbounded. |
static Latitude |
ANY_LATITUDE
A constant that may be used to indicate that the minimum or maximum latitude is unbounded. |
static Longitude |
ANY_LONGITUDE
A constant that may be used to indicate that the minimum or maximum longitude is unbounded. |
static Date |
CURRENT_TIME
A constant that indicates the current time should be used when evaluating the information held by a position. |
Constructor Summary | |
---|---|
SkyPositionFilter()
Creates a new wide-open filter that allows all positions to pass. |
Method Summary | |
---|---|
boolean |
allows(SkyPosition sp)
Returns true if this filter allows the given position to pass through it. |
boolean |
blocks(SkyPosition sp)
Returns true if this filter blocks the given position. |
void |
clearAll()
Sets this filter to a wide-open state. |
void |
clearCone()
Stops this filter from applying a cone search. |
void |
clearDistance()
Sets the distance criterion to its wide-open state. |
void |
clearLatitude()
Sets the latitude criterion to its wide-open state. |
void |
clearLongitude()
Sets the longitude criterion to its wide-open state. |
void |
clearQueryTime()
Sets this filter so that it will use the current time when querying positions sent to the allows(SkyPosition) or
blocks(SkyPosition) methods. |
Collection<? extends SkyPosition> |
removeAllBlockedParticlesFrom(Collection<? extends SkyPosition> flow)
Removes from flow any position that is blocked by this filter. |
void |
setCone(Latitude centerLatitude,
Longitude centerLongitude,
Angle searchRadius)
Sets this filter so that only positions within the cone described by the center latitude / longitude pair and the search radius may pass. |
void |
setCone(SkyPosition center,
Angle searchRadius)
Sets this filter so that only positions within the cone described by the center and the search radius may pass. |
void |
setDistance(Distance center,
Distance halfWidth)
Sets the distance range for this filter. |
void |
setDistanceRange(Distance min,
Distance max)
Sets the distance range for this filter. |
void |
setLatitude(Latitude center,
Angle halfWidth)
Sets the latitude range for this filter. |
void |
setLatitudeLongitudeRectangle(Latitude centerLatitude,
Longitude centerLongitude,
Angle halfWidth)
Sets that latitude and longitude ranges for this filter. |
void |
setLatitudeRange(Latitude min,
Latitude max)
Sets the latitude range for this filter. |
void |
setLongitude(Longitude center,
Angle halfWidth)
Sets the longitude range for this filter. |
void |
setLongitudeRange(LongitudeInterval newInterval)
Sets the longitude range for this filter. |
void |
setLongitudeRange(Longitude from,
Longitude to)
Sets the longitude range for this filter. |
void |
setQueryTime(Date time)
Sets the date and time at which the filtered position is queried for its longitude, latitude, and distance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Longitude ANY_LONGITUDE
public static final Latitude ANY_LATITUDE
public static final Distance ANY_DISTANCE
public static final Date CURRENT_TIME
Constructor Detail |
---|
public SkyPositionFilter()
Method Detail |
---|
public void clearAll()
public void clearCone()
setCone(Latitude, Longitude, Angle)
public void clearLongitude()
setLongitude(Longitude, Angle)
,
setLongitudeRange(Longitude, Longitude)
public void clearLatitude()
setLatitude(Latitude, Angle)
,
setLatitudeRange(Latitude, Latitude)
public void clearDistance()
setDistance(Distance, Distance)
,
setDistanceRange(Distance, Distance)
public void clearQueryTime()
allows(SkyPosition)
or
blocks(SkyPosition)
methods.
public void setCone(SkyPosition center, Angle searchRadius)
setCone(center.getLatitude(), center.getLongitude(), searchRadius);
center
- the center of the search cone.searchRadius
- the radius of the cone. The radius may not be
larger than one-quarter circle (e.g., 90 degrees).
If it is, an illegal argument exception is thrown.public void setCone(Latitude centerLatitude, Longitude centerLongitude, Angle searchRadius)
centerLatitude
- the latitude of the center point of the cone.centerLongitude
- the longitude of the center point of the cone.searchRadius
- the radius of the cone. The radius may not be
larger than one-quarter circle (e.g., 90 degrees).
If it is, an illegal argument exception is thrown.public void setLatitudeLongitudeRectangle(Latitude centerLatitude, Longitude centerLongitude, Angle halfWidth)
setLatitude(centerLatitude, halfWidth); setLongitude(centerLongitude, halfWidth);
centerLatitude
- the central value of the latitude range.centerLongitude
- the central value of the longitude range.halfWidth
- half the width of both the latitude and longitude ranges.public void setLongitude(Longitude center, Angle halfWidth)
center
- the central point of the range.halfWidth
- half the width of the range.public void setLongitudeRange(Longitude from, Longitude to)
from
value is allowed to be numerically larger
than the to
value. This would be the case, for example, if
you wanted to select positions whose longitudes where in the range
355 to 10 degrees.
from
- the start of the range of longitude values that are allowed to
pass through this filter. If this value is null or
ANY_LONGITUDE, a longitude of zero will be used.to
- the end of the range of longitude values that are allowed to
pass through this filter. If this value is null or
ANY_LONGITUDE, a longitude whose value is equal
to a full circle will be used.public void setLongitudeRange(LongitudeInterval newInterval)
newInterval
- the new range.public void setLatitude(Latitude center, Angle halfWidth)
center
- the central point of the range.halfWidth
- half the width of the range.public void setLatitudeRange(Latitude min, Latitude max)
ANY_LATITUDE
.
min
- the minimum latitude that is allowed to pass
through this filter.max
- the maximum latitude that is allowed to pass
through this filter.public void setDistance(Distance center, Distance halfWidth)
center
- the central point of the range.halfWidth
- half the width of the range.public void setDistanceRange(Distance min, Distance max)
ANY_DISTANCE
.
min
- the minimum distance that is allowed to pass
through this filter.max
- the maximum distance that is allowed to pass
through this filter.public void setQueryTime(Date time)
time
- the time used by the allows(SkyPosition)
and blocks(SkyPosition)
methods when
querying a position.public boolean blocks(SkyPosition sp)
blocks
in interface Filter<SkyPosition>
sp
- the position to be filtered.
sp
.public boolean allows(SkyPosition sp)
allows
in interface Filter<SkyPosition>
sp
- the position to be filtered.
sp
to pass through it.public Collection<? extends SkyPosition> removeAllBlockedParticlesFrom(Collection<? extends SkyPosition> flow)
flow
any position that is blocked by this filter.
flow
- a collection of positions that this filter will alter by
removing blocked positions.
flow
, after the removal of blocked positions.
If flow
is null, a new empty collection is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |