com.jstatcom.ts
Class TSProject

java.lang.Object
  extended by com.jstatcom.ts.TSProject
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public final class TSProject
extends java.lang.Object
implements java.beans.PropertyChangeListener

This class is in a preliminary state. It certainly needs to work with a yet to build TSProjectManager. 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:

TSProject is in sync with TSHolder via a PropertyChangeListener. This means that series that are removed from the TSHolder are also removed from the projects they belong to.

Author:
Markus Kraetzig

Field Summary
static TSProject DEFAULT_PROJECT
          Default project, where all TS are added if no other project is specified.
 
Constructor Summary
TSProject(java.lang.String projectName)
          Creates a new TSProject with a name.
TSProject(java.lang.String projectName, java.lang.String description)
          Creates a new TSProject with a name and a project description.
 
Method Summary
 void addTS(TS ts)
          Adds a time series to this project.
 java.lang.String getDescription()
          Gets the description of this project.
 java.lang.String getName()
          Gets the name of this project.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          This method is called whenever there is a property change in the connected property fields.
 void removeTS(java.lang.String name)
          Removes a time series from this project.
 void setDescription(java.lang.String newProjectDescription)
          Sets the description for this project.
 java.lang.String toString()
          Gets a string representation of this project.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PROJECT

public static final TSProject DEFAULT_PROJECT
Default project, where all TS are added if no other project is specified.

Constructor Detail

TSProject

public TSProject(java.lang.String projectName)
Creates a new TSProject with a name.

Parameters:
projectName - the name of the new project

TSProject

public TSProject(java.lang.String projectName,
                 java.lang.String description)
Creates a new TSProject with a name and a project description.

Parameters:
projectName - the name of the new project
description - 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:
propertyChange in interface java.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 - the String identifying 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:
toString in class java.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