net.agmodel.physical
Interface Sequence

All Known Subinterfaces:
AirTemperature, CompoundSequence, Humidity, LeafWetness, MetSequence, MultiQuantity, Rain, ScalarQuantity, SoilTemperature, SolarRadiation, Store, Sunshine, WaterTemperature, Wind
All Known Implementing Classes:
AirTempMaxMinImpl, AirTempMaxMinMeanImpl, AirTempMultiImpl, AirTempSingleImpl, GeneralMetSequenceImpl, GeneralSequenceImpl, LeafWetnessMultiImpl, LeafWetnessSingleImpl, MultiImpl, RainImpl, RHImpl, SoilTemperatureImpl, SolarRadiationImpl, StoreImpl, SunshineImpl, WaterTempSingleImpl, WetDryImpl, WindImpl, WindProfileImpl

public interface Sequence

Interface to sequences of measurements of some physical property.
Sequence is an parent for domain-specific descendents like MetSequence.
In some situations an implementor may contain several related time series of data (eg wet and dry bulb temperatures).
Implementors typically store data in one or more Store utility classes.
This separation is so different storage methods can be "plugged in" for different kinds of data
eg. rainfall data or leaf wetness data can readily be compressed by a kind of run length encoding. Hourly temperatures are less amenable to such compression.

Note that Sequences follow the same convention as Stores and MetRequests, which is that the range of data stored is partially closed (start,end].
This means in descendent classes you can call getInstantValue(end) but not getInstantValue(start).


Method Summary
 Object clone()
           
 String dumpSequence(DateFormat df, String delimiter, String rowTerminator)
          Gets a printable version of the sequence contents.
 String getColumnHeading()
          Deprecated. use getName() instead
 String getContentsAsString(Date time, String delimiter)
          Returns the measurement associated with a particular time as a string.
 Duration getCurrentResolution()
          Deprecated. use getResolution() instead
 Interval getDateRange()
          Returns the date range for which data can be stored in the sequence
 String getName()
          Returns a language independent name for the Sequence This name is typically used as a resourceBundle key or to identify the Sequence programmatically.
 int getNumberOfSubComponents()
          Get the number of sub-components in the sequence.
 Duration getResolution()
          Returns the current resolution of data in the sequence (eg daily);
 String getSequenceHeading(String delimiter)
          Returns a localized top level description of the kind of data stored in the sequence.
 String getSubHeading(String delimiter)
          Gets a localized subheading, assumed to be in the context of an overall column heading.
 SummaryKind getSummaryKind()
          Returns the current summarykind of data in the sequence (eg averaged);
 String getUnitsHeading(String delimiter)
          Gets a string representation of the measurement units of the column.
 void setColumnHeading(String aHeading)
          Deprecated. use setName(String) or setSequenceHeading(String) instead
 void setName(String aName)
          Sets the language independent name for the Sequence This name is typically used as a resourceBundle key or to identify the Sequence programmatically.
 

Method Detail

getDateRange

public Interval getDateRange()
Returns the date range for which data can be stored in the sequence

Returns:
the date range

getCurrentResolution

public Duration getCurrentResolution()
Deprecated. use getResolution() instead

Returns the current resolution of data in the sequence (eg daily);


getResolution

public Duration getResolution()
Returns the current resolution of data in the sequence (eg daily);


getSummaryKind

public SummaryKind getSummaryKind()
Returns the current summarykind of data in the sequence (eg averaged);


getColumnHeading

public String getColumnHeading()
Deprecated. use getName() instead

Returned a localized label for the Sequence


setColumnHeading

public void setColumnHeading(String aHeading)
Deprecated. use setName(String) or setSequenceHeading(String) instead

Set the localized label for the Sequence

Parameters:
aHeading - the new heading

getSequenceHeading

public String getSequenceHeading(String delimiter)
Returns a localized top level description of the kind of data stored in the sequence. This value can be used as a column heading if the sequence is listed. If there is more than one component in the heading, this value is right-padded with additional delimiters - one for each component.

Parameters:
delimiter - the delimiter to use if padding is required for multiple columns

getSubHeading

public String getSubHeading(String delimiter)
Gets a localized subheading, assumed to be in the context of an overall column heading.

Parameters:
delimiter - the delimiter to use between columns if there are multiple columns
See Also:
getNumberOfSubComponents(), getSequenceHeading(String)

getNumberOfSubComponents

public int getNumberOfSubComponents()
Get the number of sub-components in the sequence. This indicates how many "columns" the sequence output will occupy.

Returns:
the number of sub-components
See Also:
getSequenceHeading(String)

getUnitsHeading

public String getUnitsHeading(String delimiter)
Gets a string representation of the measurement units of the column. This value is typically used as part of the column heading when the sequence is listed. It is assumed to be in the context of an overall column heading.

Parameters:
delimiter - the delimiter to use between columns if there are multiple columns
See Also:
getNumberOfSubComponents(), getSequenceHeading(String), getSubHeading(String)

getName

public String getName()
Returns a language independent name for the Sequence This name is typically used as a resourceBundle key or to identify the Sequence programmatically. It should be localized before presentation to users.


setName

public void setName(String aName)
Sets the language independent name for the Sequence This name is typically used as a resourceBundle key or to identify the Sequence programmatically. It should be localized before presentation to users.

Parameters:
aName - the new heading

getContentsAsString

public String getContentsAsString(Date time,
                                  String delimiter)
Returns the measurement associated with a particular time as a string. Used by dumpSequence.

Parameters:
time - the time of interest.
delimiter - a string to use between values if required.

dumpSequence

public String dumpSequence(DateFormat df,
                           String delimiter,
                           String rowTerminator)
Gets a printable version of the sequence contents.
Data is formatted with a line for each time interval.
The first field in the line is the date and time, formatted using the DateFormat passed as a parameter.
The data for that time interval follows, separated by the default delimiter, with a new line character at the end of the row.

Parameters:
df - the format to use for the date and time
delimiter - the separator to use between the date and the data
rowTerminator - the String used at the end of each row
Returns:
a string containing all the sequences data with formatted times.

clone

public Object clone()