Venice 0.751beta

nz.org.venice.chart
Class PFGraphable

java.lang.Object
  extended bynz.org.venice.chart.Graphable
      extended bynz.org.venice.chart.PFGraphable

public class PFGraphable
extends Graphable

Represents a graphable set of X points and their associated list of Y points.

Author:
Mark Hummel

Constructor Summary
PFGraphable()
          Create an empty PFgraphable.
 
Method Summary
 boolean dataAvailable(java.util.Vector x)
           
 double getBoxPrice()
          Return the box price for this graph
 int getColumnSpan()
          Return the size of the column span.
 TradingDate getDate(java.lang.Comparable x)
          Get the date value for the given X value.
 java.lang.Comparable getEndX()
          Get the last X value where we have an associated Y value.
 double getHighestY(java.util.List xRange)
          Given an X range, inspect all the associated Y values and return the highest.
 double getLowestY(java.util.List xRange)
          Given an X range, inspect all the associated Y values and return the lowest.
 java.lang.Comparable getStartX()
          Get the first X value where we have an associated Y value.
 java.lang.String getString(java.lang.Comparable x)
          Get the character value for the given X value.
 java.util.Set getXRange()
          Get all the X values for where we have an associated Y value.
 java.util.Vector getYList(java.lang.Comparable x)
          Get the Y value for the given X value.
 void putData(java.lang.Comparable x, java.lang.Comparable date, java.util.Vector list, java.lang.String marker)
          Associate the given X value with the given data.
 void putDate(java.lang.Comparable x, java.lang.Comparable y)
          Associate the given X value with the given Y value.
 void putString(java.lang.Comparable x, java.lang.String s)
          Associate the given x value with the given character.
 void putYList(java.lang.Comparable x, java.util.Vector y)
          Associate the given X value with the given Y value.
 void setBoxPrice(double value)
          Set the box price at graph generation
 void setColumnSpan(int value)
          Set the size of the date column span.
 
Methods inherited from class nz.org.venice.chart.Graphable
getMap, getY, iterator, putY, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PFGraphable

public PFGraphable()
Create an empty PFgraphable.

Method Detail

getEndX

public java.lang.Comparable getEndX()
Get the last X value where we have an associated Y value.

Overrides:
getEndX in class Graphable
Returns:
the last x value which we contain data

getStartX

public java.lang.Comparable getStartX()
Get the first X value where we have an associated Y value.

Overrides:
getStartX in class Graphable
Returns:
the first x value which we contain data

getYList

public java.util.Vector getYList(java.lang.Comparable x)
Get the Y value for the given X value.

Parameters:
x - the x value
Returns:
y the associated y value

getString

public java.lang.String getString(java.lang.Comparable x)
Get the character value for the given X value.

Parameters:
x - the x value
Returns:
y the associated character value

getDate

public TradingDate getDate(java.lang.Comparable x)
Get the date value for the given X value.

Parameters:
x - the x value
Returns:
y the associated character value

getBoxPrice

public double getBoxPrice()
Return the box price for this graph

Returns:
box price The box price

getColumnSpan

public int getColumnSpan()
Return the size of the column span.

Returns:
columnSpan The column span

putData

public void putData(java.lang.Comparable x,
                    java.lang.Comparable date,
                    java.util.Vector list,
                    java.lang.String marker)
Associate the given X value with the given data. This function is used to "load" up the graphable with data.

Parameters:
x - the x value
date - a date representing the point at which data changed
list - a list of price values within a move.
marker - a string denoting a price value as an upmove or downmove.

setBoxPrice

public void setBoxPrice(double value)
Set the box price at graph generation

Parameters:
value - The box price which represents the smallest plottable price point

setColumnSpan

public void setColumnSpan(int value)
Set the size of the date column span. A PF graph does not necessarily have price data for a particular date.

Parameters:
value - The size of the column span

putDate

public void putDate(java.lang.Comparable x,
                    java.lang.Comparable y)
Associate the given X value with the given Y value. This function is used to "load" up the graphable with data.

Parameters:
x - the x value
y - the y value

putYList

public void putYList(java.lang.Comparable x,
                     java.util.Vector y)
Associate the given X value with the given Y value. This function is used to "load" up the graphable with data.

Parameters:
x - the x value
y - the associated List of y values

putString

public void putString(java.lang.Comparable x,
                      java.lang.String s)
Associate the given x value with the given character. This function is used to "load" up the graphable with data.

Parameters:
x - the x value
s - the associated character

getHighestY

public double getHighestY(java.util.List xRange)
Given an X range, inspect all the associated Y values and return the highest.

Overrides:
getHighestY in class Graphable
Parameters:
xRange - a List of Comparable objects
Returns:
the highest Y value

getLowestY

public double getLowestY(java.util.List xRange)
Given an X range, inspect all the associated Y values and return the lowest.

Overrides:
getLowestY in class Graphable
Parameters:
xRange - a List of Comparable objects
Returns:
the lowest Y value

getXRange

public java.util.Set getXRange()
Get all the X values for where we have an associated Y value.

Overrides:
getXRange in class Graphable
Returns:
the set of all X values which have associated Y values

dataAvailable

public boolean dataAvailable(java.util.Vector x)

Venice 0.751beta