|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jstatcom.ts.TSHolder
public class TSHolder
Holds all available TS at runtime. The identifying keys are
the names of the time series. The names are converted to lowercase, which
makes the lookup case insensitive. It also provides methods for adding,
removing, and reading of time series. This class is designed as a Singleton
(Gamma et al., 1995) and can be accessed by the static
getInstance method.
Classes can register themselves as PropertyChangeListeners to
the TSHolder if they should be notified when
TS_ADDED or TS_REMOVED events happen.
This class is designed to be thread-save for adding, removing, and reading of time series.
TS,
TSList| Field Summary | |
|---|---|
static java.lang.String |
ALL_TS_REMOVED
|
static java.lang.String |
TS_ADDED
PropertyChange values. |
static java.lang.String |
TS_REMOVED
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
int |
addTS(TS newTimeSeries)
Adds a new TS to this TSHolder. |
boolean |
contains(java.lang.String name)
Returns whether the TSHolder contains a TS
with the given name. |
TS[] |
getAllTS()
Gets all time series. |
javax.swing.ListModel |
getAsListModel()
Gets TSHolder represented as a ListModel
with the names in alphabetical order. |
static TSHolder |
getInstance()
Returns Singleton instance of a TSHolder. |
ProjectData |
getProjectData()
Gets the project data from this shared data repository. |
ProjectDataTypes |
getProjectDataType()
Returns time series data type. |
TS |
getTS(java.lang.String name)
Retrieves a time series for a given name. |
java.util.Iterator<java.lang.String> |
getTSNames()
Returns names of all available time series. |
void |
removeAllTS()
Removes all time series from the map and fires an ALL_TS_REMOVED PropertyChangeEvent if there were any
series removed. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
removeTS(java.lang.String name)
Removes a time series from the map and fires a TS_REMOVED PropertyChangeEvent. |
void |
setProjectData(ProjectData pData)
Sets the project data to this shared data repository for time series. |
void |
setTS(TS[] newTimeSeries)
Clears all currently stored time series and adds the series contained in newTimeSeries. |
java.lang.String |
toString()
String representation of this TSHolder. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TS_ADDED
public static final java.lang.String TS_REMOVED
public static final java.lang.String ALL_TS_REMOVED
| Method Detail |
|---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void setTS(TS[] newTimeSeries)
newTimeSeries.
newTimeSeries - array of time series to addpublic int addTS(TS newTimeSeries)
TS to this TSHolder. If a
series has less than 2 observations, an error message is displayed. If a
series with the same name already exists, a question is displayed,
whether the existing series should be overwritten. This method returns
JOptionPane.YES_OPTION if newTimeSeries was
null.
If the series was added, a TS_ADDED PropertyChangeEvent is
fired.
newTimeSeries - the new TS to add
JOptionPane.YES_OPTION,
JOptionPane.NO_OPTION or
JOptionPane.CANCEL_OPTION, which the calling
method can process accordingly. If
JOptionPane.YES_OPTION is returned, the time
series was added successfully.public boolean contains(java.lang.String name)
TSHolder contains a TS
with the given name. The lookup is case insensitive.
name - String with the name to be looked up
public javax.swing.ListModel getAsListModel()
TSHolder represented as a ListModel
with the names in alphabetical order.
public static TSHolder getInstance()
TSHolder.
public TS getTS(java.lang.String name)
name - of the time series to get
TS with the given name, null if it
does not existpublic TS[] getAllTS()
public java.util.Iterator<java.lang.String> getTSNames()
TSpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removeTS(java.lang.String name)
TS_REMOVED PropertyChangeEvent. Nothing happens, if no
series with the given name was stored.
name - of the time series to getpublic void removeAllTS()
ALL_TS_REMOVED PropertyChangeEvent if there were any
series removed.
public java.lang.String toString()
TSHolder.
toString in class java.lang.ObjectTSpublic void setProjectData(ProjectData pData)
setProjectData in interface ProjectDataHandlerpData - project data to setpublic ProjectData getProjectData()
getProjectData in interface ProjectDataHandlerpublic ProjectDataTypes getProjectDataType()
getProjectDataType in interface ProjectDataHandlerProjectDataTypes.TS_DATA
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||