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

Field Summary
 double close
           
 Date day
           
 double high
           
 double logDiff
           
 double logHigh
           
 double logLow
           
 double logX
           
 double low
           
 double open
           
 char status
           
 long volume
           
 
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.
 boolean equals(java.lang.Object o)
           
 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.
 void setStatus()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logHigh

public double logHigh

logLow

public double logLow

logDiff

public double logDiff

open

public double open

close

public double close

high

public double high

low

public double low

logX

public double logX

volume

public long volume

status

public char status

day

public Date day
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

setStatus

public void setStatus()

getVolume

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

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object o)


Copyright © 2004 Kaare Ranum