com.jstatcom.ts
Class TSProjectData

java.lang.Object
  extended by com.jstatcom.ts.TSProjectData
All Implemented Interfaces:
ProjectData

public final class TSProjectData
extends java.lang.Object
implements ProjectData

Implementation of ProjectData for the time series data type. It stores the data for a project and can be (de)serialized.

Author:
Markus Kraetzig

Field Summary
static javolution.xml.XmlFormat<TSProjectData> TSProjectData_XML
          XML format field for (de)serialization.
 
Constructor Summary
TSProjectData()
          Default constructor.
 
Method Summary
 java.lang.String getDescription()
          Gets the data description.
 JSCData[] getJSCData()
          Gets the project data as an array of JSCData objects.
 ProjectDataTypes getProjectDataType()
          Gets the time series data type.
 void setDescription(java.lang.String dataDescription)
          Sets the data description.
 void setJSCData(JSCData[] dataArray)
          Sets the data array for the underlying data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TSProjectData_XML

public static final javolution.xml.XmlFormat<TSProjectData> TSProjectData_XML
XML format field for (de)serialization.

Constructor Detail

TSProjectData

public TSProjectData()
Default constructor.

Method Detail

getDescription

public java.lang.String getDescription()
Gets the data description.

Specified by:
getDescription in interface ProjectData
Returns:
descriptive string

setDescription

public void setDescription(java.lang.String dataDescription)
Sets the data description. If the string argument is null then "" is used instead.

Specified by:
setDescription in interface ProjectData
Parameters:
dataDescription - a descriptive string

setJSCData

public void setJSCData(JSCData[] dataArray)
Sets the data array for the underlying data. The array is a vector with 4*(number of time series) elements which must be in the following order:
  1. JSCString - string with the name of the 1st time series
  2. JSCString - string representing the data type of the 1st time series, for example "endogenous"
  3. JSCDate - start date of the 1st time series
  4. JSCNArray - data vector of the 1st time series
  5. ... the same for the remaining time series

Usage Note:
The argument data array is not copied by this method but the reference is used. Clients should make sure that the data is not modified afterwards. This is reasonable because usually the data is not referenced from outside the calling method.

Specified by:
setJSCData in interface ProjectData
Parameters:
dataArray - the array with the data to be stored
Throws:
java.lang.IllegalArgumentException - if (dataArray == null)
java.lang.RuntimeException - if the elements in the data array are not of the correct type, or if there are null elements, or if the number of array elements is not a multiple of 4

getJSCData

public JSCData[] getJSCData()
Gets the project data as an array of JSCData objects. For the ordering of the elements of this array, see the setJSCData method.

Usage Note:
The returned data array is a reference to the array used by this object. Clients should not modify it.

Specified by:
getJSCData in interface ProjectData
Returns:
reference to the data array
See Also:
setJSCData(JSCData[])

getProjectDataType

public ProjectDataTypes getProjectDataType()
Gets the time series data type.

Specified by:
getProjectDataType in interface ProjectData
Returns:
ProjectDataTypes.TS_DATA