net.agmodel.weatherData
Class MetRequest

java.lang.Object
  extended bynet.agmodel.weatherData.MetRequest
All Implemented Interfaces:
Serializable, ServerRequest
Direct Known Subclasses:
SpatialMetRequest, StationMetRequest

public abstract class MetRequest
extends Object
implements ServerRequest

Classes descending from MetRequest encapsulate all the details required in a request for meteorological data.
MetRequest is an abstract class which manages attributes which are common to all requests.
Descendant objects differ mainly in how they specify where the data is to come from.
StationMetRequest requests data from a specified station.
SpatialMetRequest requests data from all stations within an area.

Interpretation of dateExtremes in queries

For point measurement data, MetBroker returns any data in the partially closed interval (start,end]
If the data is measured over periods of time, rather than at discrete points, MetBroker returns the data of any interval whose endpoint falls in the partially closed interval (start,end].

In general, client applications will only use the MetRequest constructors.
The remaining methods are primarily for MetBroker's internal use.

Author:
Matthew Laurenson
See Also:
Serialized Form

Method Summary
 boolean containsMetElement(MetElement aMetElement)
          Indicates whether a meteorological element is included in a request
 Interval getDateExtremes()
          Gets the interval for which data is requested.
 Duration getElapsedTime()
          Returns the elapsed time since the last call to setProcessingCommenced.
Called by MetBroker just before it returns the query results.
Normally client applications would use StationDataSet.getServerProcessingTime().
 MetElement[] getRequested()
          Gets all the meteorological elements requested.
 MetDuration getResolution()
          Gets the requested resolution for the result of the query.
 void setProcessingCommenced()
          Sets the time that processing commenced using a timing source like System.currentTimeMillis()
Called by MetBroker when it receives a query.
Normally client applications would not use this.
 boolean shouldInterpolate()
          Gets whether the query requests interpolation.
 boolean shouldSummarise()
          Gets whether the query requests summarisation.
 String toString()
          Get a string representation of the query parameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

containsMetElement

public boolean containsMetElement(MetElement aMetElement)
Indicates whether a meteorological element is included in a request

Parameters:
aMetElement - the element of interest
Returns:
true if the request includes the element, false otherwise

getDateExtremes

public Interval getDateExtremes()
Gets the interval for which data is requested.

Returns:
the request interval

getRequested

public MetElement[] getRequested()
Gets all the meteorological elements requested.

Returns:
an array of requested elements

getResolution

public MetDuration getResolution()
Gets the requested resolution for the result of the query. If summarising or interpolating are enabled, data having other resolutions may be processed to this resolution

Returns:
the resolution

setProcessingCommenced

public void setProcessingCommenced()
Sets the time that processing commenced using a timing source like System.currentTimeMillis()
Called by MetBroker when it receives a query.
Normally client applications would not use this.


getElapsedTime

public Duration getElapsedTime()
Returns the elapsed time since the last call to setProcessingCommenced.
Called by MetBroker just before it returns the query results.
Normally client applications would use StationDataSet.getServerProcessingTime().

Returns:
the elapsed duration

shouldSummarise

public boolean shouldSummarise()
Gets whether the query requests summarisation.

Returns:
true if the query requests that data be summarised, false otherwise.

shouldInterpolate

public boolean shouldInterpolate()
Gets whether the query requests interpolation.

Returns:
true if the query requests that data be interpolated, false otherwise.

toString

public String toString()
Get a string representation of the query parameters

Returns:
a string in a mixture of English and the default language;


Copyright (C) NARC 2001 All Rights Reserved.