Venice 0.751beta

nz.org.venice.chart.source
Class OHLCVQuoteGraphSource

java.lang.Object
  extended bynz.org.venice.chart.source.OHLCVQuoteGraphSource
All Implemented Interfaces:
GraphSource

public class OHLCVQuoteGraphSource
extends java.lang.Object
implements GraphSource

Provides a EODQuoteBundle graph source. This class allows graph sources for day Open, High, Low, Close and Volume (OHLCV).

Author:
Andrew Leppard

Field Summary
 
Fields inherited from interface nz.org.venice.chart.source.GraphSource
ADVANCEDECLINE, INDEX, PORTFOLIO, SYMBOL
 
Constructor Summary
OHLCVQuoteGraphSource(EODQuoteBundle quoteBundle, int quote)
          Create a new graph source from the quote bundle with the given quote type.
 
Method Summary
 void adjust(int type, double value, java.lang.Comparable startPoint, boolean forward)
          Apply an adjustment to the data.
 double[] getAcceptableMajorDeltas()
          Return an array of acceptable major deltas for the vertical axis.
 double[] getAcceptableMinorDeltas()
          Return an array of acceptable minor deltas for the vertical axis.
 Graphable getGraphable()
          Get the actual graphable data.
 java.lang.String getName()
          Return the name of the data.
 java.lang.String getToolTipText(java.lang.Comparable x)
          Get the tool tip text for the given X value
 int getType()
          Return the type of the data.
 java.lang.String getYLabel(double value)
          Convert the Y value to a label to be displayed in the vertical axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OHLCVQuoteGraphSource

public OHLCVQuoteGraphSource(EODQuoteBundle quoteBundle,
                             int quote)
Create a new graph source from the quote bundle with the given quote type.

Parameters:
quoteBundle - the quote bundle containing stock quotes
quote - the quote kind, one of: Quote.DAY_OPEN, Quote.DAY_CLOSE, Quote.DAY_HIGH or Quote.DAY_LOW
Method Detail

getGraphable

public Graphable getGraphable()
Description copied from interface: GraphSource
Get the actual graphable data.

Specified by:
getGraphable in interface GraphSource
Returns:
the graphable data

getName

public java.lang.String getName()
Description copied from interface: GraphSource
Return the name of the data.

Specified by:
getName in interface GraphSource
Returns:
the name

getType

public int getType()
Description copied from interface: GraphSource
Return the type of the data.

Specified by:
getType in interface GraphSource
Returns:
the type

adjust

public void adjust(int type,
                   double value,
                   java.lang.Comparable startPoint,
                   boolean forward)
Description copied from interface: GraphSource
Apply an adjustment to the data.

Specified by:
adjust in interface GraphSource
Parameters:
type - A split or a dividend.
value - The value applied to each data point from start point.
startPoint - The point in the data from which to start adjusting.
forward - If true, will adjust the data in a positive direction.

getToolTipText

public java.lang.String getToolTipText(java.lang.Comparable x)
Description copied from interface: GraphSource
Get the tool tip text for the given X value

Specified by:
getToolTipText in interface GraphSource
Parameters:
x - the X value
Returns:
the tooltip text

getYLabel

public java.lang.String getYLabel(double value)
Description copied from interface: GraphSource
Convert the Y value to a label to be displayed in the vertical axis.

Specified by:
getYLabel in interface GraphSource
Parameters:
value - y value
Returns:
the label text

getAcceptableMajorDeltas

public double[] getAcceptableMajorDeltas()
Description copied from interface: GraphSource
Return an array of acceptable major deltas for the vertical axis.

Specified by:
getAcceptableMajorDeltas in interface GraphSource
Returns:
array of doubles
See Also:
Graph.getAcceptableMajorDeltas()

getAcceptableMinorDeltas

public double[] getAcceptableMinorDeltas()
Description copied from interface: GraphSource
Return an array of acceptable minor deltas for the vertical axis.

Specified by:
getAcceptableMinorDeltas in interface GraphSource
Returns:
array of doubles
See Also:
Graph.getAcceptableMajorDeltas()

Venice 0.751beta