com.exponto.jstock.data
Class ChartData

java.lang.Object
  extended byjava.util.Observable
      extended bycom.exponto.jstock.data.ChartData

public class ChartData
extends java.util.Observable

ChartData.java Load the dataset from file or other source. Can transform dataset to other formats (log, weekly) as required. Does contain some buisness logic (I'll try to move it out of here)

Author:
kaare

Constructor Summary
ChartData(TickerID tId, java.lang.String panelType)
          Creates ChartData for a daily series.
ChartData(TickerID tId, java.lang.String panelType, LogDataSeries lDS)
          Used to create ChartData for weekly charts.
 
Method Summary
 java.util.ArrayList getAllIndicators()
           
 java.util.ArrayList getDefaultIndicators()
           
 java.util.ArrayList getEnabledCandleStickIndicators()
           
 java.util.ArrayList getEnabledIndicators()
           
 LogDataSeries getLogDataSeries()
           
 Indicator getMainIndicator()
           
 java.lang.String getPanelType()
           
 TickerID getTickerID()
           
 void insertIndicator(java.util.ArrayList newIndicators)
          Adds new indicators to the chart.
 void loadDBIndicators()
          Loads the indicators as stored in the database.
 int numberOfPanels()
          Returns the number of indicators that needs a separate JPanel in order to draw a series.
 void saveDBIndicators()
          Checks if the IndicatorParameters are known in the database before saving them.
 void setPanelType(java.lang.String name)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartData

public ChartData(TickerID tId,
                 java.lang.String panelType)
          throws TickerNotFoundException
Creates ChartData for a daily series. Should work for weekly as well, but will do the file reading once more (if it is already read for a daily series)

Parameters:
tId - the TickerID to create ChartData for
panelType - - currently only daily and weekly are supported
Throws:
TickerNotFoundException

ChartData

public ChartData(TickerID tId,
                 java.lang.String panelType,
                 LogDataSeries lDS)
          throws TickerNotFoundException
Used to create ChartData for weekly charts. Uses the the LogDataSeries found for the daily chart. Should work well for daily charts as well if lDS is null.

Parameters:
tId - the TickerID to create ChartData for
panelType - - the type of panel (daily weekly ...)
lDS - the LogDataSeries from the charts
Throws:
TickerNotFoundException
Method Detail

insertIndicator

public void insertIndicator(java.util.ArrayList newIndicators)
Adds new indicators to the chart.


saveDBIndicators

public void saveDBIndicators()
Checks if the IndicatorParameters are known in the database before saving them. If new parameters are spotted new DBIndicatorParameter are created rather than changing the old since that may mess up (indicator) lines.


loadDBIndicators

public void loadDBIndicators()
Loads the indicators as stored in the database.


numberOfPanels

public int numberOfPanels()
Returns the number of indicators that needs a separate JPanel in order to draw a series. Indicators that are drawn with the candlestick chart are not counted nor is indicators that are disabled.

Returns:
the number of panels needed to draw the indicators

getEnabledCandleStickIndicators

public java.util.ArrayList getEnabledCandleStickIndicators()
Returns:
an ArrayList with all Indicators that shall be drawn together with the candlestickPanel

getEnabledIndicators

public java.util.ArrayList getEnabledIndicators()
Returns:
an ArrayList with all Indicators that shall be drawn in a separate JPanel

getLogDataSeries

public LogDataSeries getLogDataSeries()
Returns:
the LogDataSeries

getTickerID

public TickerID getTickerID()
Returns:
Returns the TickerID.

getPanelType

public java.lang.String getPanelType()
Returns:
Returns the m_panelName.

setPanelType

public void setPanelType(java.lang.String name)
Parameters:
name - The m_panelName to set.

getMainIndicator

public Indicator getMainIndicator()
Returns:

getAllIndicators

public java.util.ArrayList getAllIndicators()
Returns:
Returns the m_dbIndicatorList.

getDefaultIndicators

public java.util.ArrayList getDefaultIndicators()
Returns:
Returns the m_defaultIndicators.


Copyright © 2004 Kaare Ranum