com.jstatcom.ts
Class TSProject
- java.lang.Object
-
- com.jstatcom.ts.TSProject
-
- All Implemented Interfaces:
- java.beans.PropertyChangeListener, java.util.EventListener
public final class TSProject extends java.lang.Object implements java.beans.PropertyChangeListenerThis class is in a preliminary state. It certainly needs to work with a yet to buildTSProjectManager. So far its only purpose is to store project descriptions. Further experience needs to be gained on how a usable project management for time series projects can be implemented.Stores common information for a set of
TS. This is so far:- names of time series that belong to the project
- description of the project
TSProjectis in sync withTSHoldervia aPropertyChangeListener. This means that series that are removed from theTSHolderare also removed from the projects they belong to.
-
-
Field Summary
Fields Modifier and Type Field and Description static TSProjectDEFAULT_PROJECTDefault project, where allTSare added if no other project is specified.
-
Constructor Summary
Constructors Constructor and Description TSProject(java.lang.String projectName)Creates a newTSProjectwith a name.TSProject(java.lang.String projectName, java.lang.String description)Creates a newTSProjectwith a name and a project description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddTS(TS ts)Adds a time series to this project.java.lang.StringgetDescription()Gets the description of this project.java.lang.StringgetName()Gets the name of this project.voidpropertyChange(java.beans.PropertyChangeEvent evt)This method is called whenever there is a property change in the connected property fields.voidremoveTS(java.lang.String name)Removes a time series from this project.voidsetDescription(java.lang.String newProjectDescription)Sets the description for this project.java.lang.StringtoString()Gets a string representation of this project.
-
-
-
Field Detail
-
DEFAULT_PROJECT
public static final TSProject DEFAULT_PROJECT
Default project, where allTSare added if no other project is specified.
-
-
Constructor Detail
-
TSProject
public TSProject(java.lang.String projectName)
Creates a newTSProjectwith a name.- Parameters:
projectName- the name of the new project
-
TSProject
public TSProject(java.lang.String projectName, java.lang.String description)Creates a newTSProjectwith a name and a project description.- Parameters:
projectName- the name of the new projectdescription- the project description
-
-
Method Detail
-
addTS
public void addTS(TS ts)
Adds a time series to this project. Nothing happens, if the series is already contained.- Parameters:
ts- time series to be added to this project
-
getDescription
public java.lang.String getDescription()
Gets the description of this project. It should contain a short remark about every time series in the project.- Returns:
- the project description
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
This method is called whenever there is a property change in the connected property fields. The action depends on the source determined.- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener- Parameters:
evt- a property change event
-
removeTS
public void removeTS(java.lang.String name)
Removes a time series from this project. Nothing happens, if series is not in the project.- Parameters:
name- theStringidentifying the time series to remove
-
setDescription
public void setDescription(java.lang.String newProjectDescription)
Sets the description for this project. It should contain a short remark about every time series in the project.- Parameters:
newProjectDescription- the new description
-
toString
public java.lang.String toString()
Gets a string representation of this project.- Overrides:
toStringin classjava.lang.Object- Returns:
- representation contains this name and the names of all contained
TS
-
getName
public java.lang.String getName()
Gets the name of this project.- Returns:
- name
-
-
DMelt 3.0 © DataMelt by jWork.ORG