com.exponto.jstock
Class LogTradingData

java.lang.Object
  extended bycom.exponto.jstock.LogTradingData
All Implemented Interfaces:
java.lang.Cloneable

public class LogTradingData
extends java.lang.Object
implements java.lang.Cloneable

Contains all data for a particular stock for a single day. Because Rectangle2D does not understand negative heigth it uses (logx, -, -, logh) where logx is the largest value of open and close.

Version:
0.9
Author:
kaare

Constructor Summary
LogTradingData()
          Creates new LogChartData If real data is added later, be sure to update the status field
LogTradingData(char s)
          Creates new LogChartData with only the status field set.
LogTradingData(Date d, double o, double h, double l, double c, long v, char s)
          Creates new LogChartData with complete dataset
 
Method Summary
 java.lang.Object clone()
          Note that clone() doesn't clone the date, so don't change unless intend to change it for all others using that date.
 void computeLogValues()
          Computes the logaritmic values that normally is stored with the data.
 double getClose()
           
 Date getDate()
           
 char getStatus()
           
 long getVolume()
           
 boolean isTraded()
          Check if the LogTradingData is traded.
 boolean isUsable()
          Check if the LogTradingData should be used in further processing.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogTradingData

public LogTradingData()
Creates new LogChartData If real data is added later, be sure to update the status field


LogTradingData

public LogTradingData(Date d,
                      double o,
                      double h,
                      double l,
                      double c,
                      long v,
                      char s)
Creates new LogChartData with complete dataset


LogTradingData

public LogTradingData(char s)
Creates new LogChartData with only the status field set.

Parameters:
s - status field
Method Detail

computeLogValues

public void computeLogValues()
Computes the logaritmic values that normally is stored with the data.


clone

public java.lang.Object clone()
Note that clone() doesn't clone the date, so don't change unless intend to change it for all others using that date. All other values are real copies so they may be changed without such consequences.


isUsable

public boolean isUsable()
Check if the LogTradingData should be used in further processing. If status is unknow, missing, faulty or drop data is considered unusable Note that no trade is considered "normal", even if they might mess up things if ignored

Returns:
boolean true is data can be used in further processing false if data is not to be trusted

isTraded

public boolean isTraded()
Check if the LogTradingData is traded. If status is unknow, missing, faulty drop, or no trade false is returned

Returns:
boolean true is data is traded false not traded or faulty data

getClose

public double getClose()
Returns:
the closing price of the current dataset

getDate

public Date getDate()
Returns:
the date of the current dataset

getStatus

public char getStatus()
Returns:
the status of the current dataset

getVolume

public long getVolume()
Returns:
the volume of the current dataset


Copyright © 2004 Kaare Ranum