KavaChart 5.2.2 API

com.ve.kavachart.chart
Class Datum

java.lang.Object
  extended bycom.ve.kavachart.chart.Datum
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
CandlestickDatum, LeafDatum

public class Datum
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The Datum class is used as the basic KavaChart data storage unit. This class can accomodate several concurrent observations (such as a date, high, low, and close for a financial chart) as well as labels and graphical attributes.

See Also:
Dataset, Serialized Form

Field Summary
static double DEFAULT
           
static java.lang.String DISCONTINUITY
           
 
Constructor Summary
Datum(double dataX, double dataY, boolean individual, Globals g)
          Constructs Datum with unique color, initializes X and Y values.
Datum(double dataX, double hi, double lo, double close, Globals g)
          Constructor for HiLoClose charts.
Datum(double dataX, double dataY, double dataZ, int element, Globals g)
          Constructs a Datum appropriate for use in Hi-Lo charts.
Datum(double dataX, double dataY, double dataZ, java.lang.String str, int element, Globals g)
          Constructs a Datum appropriate for use in Hi-Lo charts.
Datum(double dataX, double dataY, Globals g)
          Constructs Datum with a default Gc, initializes X and Y values.
Datum(double dataX, double dataY, int setNumber, Globals g)
          Datum with colors (Gc) initialized by dataset index number.
Datum(double dataX, double dataY, java.lang.String str, boolean individual, Globals g)
          Constructs Datum with unique color, initializes X, Y and label values.
Datum(double dataX, double dataY, java.lang.String str, int element, Globals g)
          Constructs a Datum with a Gc based on this Datum's place within a Dataset.
Datum(double dataY, java.lang.String str, int element, Globals g)
          Constructs a Datum with a Gc based on this Datum's place within a Dataset.
Datum(int whichPoint, double dataY, java.lang.String str, Globals g)
          Construct Datum with predictable color, initializes X, Y and label values.
 
Method Summary
 java.lang.Object clone()
          Method
 Gc getGc()
          Returns this Datum's Gc
 Globals getGlobals()
           
 java.lang.String getLabel()
          Returns this Datum's label
 java.lang.String getString()
          Returns label, if it exists.
 double getX()
          Returns value of X.
 double getY()
          Returns value of Y.
 double getY2()
          Returns value of Y2.
 double getY3()
          Returns value of Y3.
 void setGc(Gc g)
          Assigns a new Gc class to this Datum
 void setGlobals(Globals g)
           
 void setLabel(java.lang.String s)
          Sets this Datum's label to a new value.
 void setX(double d)
          Sets X to a new value.
 void setY(double d)
          Sets Y to a new value.
 void setY2(double d)
          Sets Y2 to a new value.
 void setY3(double d)
          Sets Y3 to a new value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISCONTINUITY

public static final java.lang.String DISCONTINUITY
See Also:
Constant Field Values

DEFAULT

public static final double DEFAULT
See Also:
Constant Field Values
Constructor Detail

Datum

public Datum(double dataX,
             double hi,
             double lo,
             double close,
             Globals g)
Constructor for HiLoClose charts. Initializes 4 data elements: x, hi, lo, and close.

Parameters:
dataX - X value (possibly a date)
hi - High price for a period
lo - Low price for a period
close - Closing price for a period
g - this chart's Globals class

Datum

public Datum(double dataX,
             double dataY,
             double dataZ,
             int element,
             Globals g)
Constructs a Datum appropriate for use in Hi-Lo charts. Assigns a Gc based on this Datum's position within a Dataset. Initializes X, Y and Z (or auxilary Y) values.

Parameters:
dataX - X value
dataY - Y value
dataZ - Z value
element - position within Dataset
g - this chart's Globals class

Datum

public Datum(double dataX,
             double dataY,
             double dataZ,
             java.lang.String str,
             int element,
             Globals g)
Constructs a Datum appropriate for use in Hi-Lo charts. Assigns a Gc based on this Datum's position within a Dataset. Initializes X, Y and Z (or auxilary Y) values. Also initializes a label.

Parameters:
dataX - X value
dataY - Y value
dataZ - Z value
str - Label
element - position within Dataset
g - this chart's Globals class

Datum

public Datum(double dataX,
             double dataY,
             int setNumber,
             Globals g)
Datum with colors (Gc) initialized by dataset index number. Initializes X and Y values.

Parameters:
dataX - X value
dataY - Y value
setNumber - Dataset index number
g - This chart's Globals class

Datum

public Datum(double dataX,
             double dataY,
             java.lang.String str,
             int element,
             Globals g)
Constructs a Datum with a Gc based on this Datum's place within a Dataset. Also initializes a label and X and Y values.

Parameters:
dataX - X value
dataY - Y value
str - Label
element - Element number

Datum

public Datum(double dataX,
             double dataY,
             java.lang.String str,
             boolean individual,
             Globals g)
Constructs Datum with unique color, initializes X, Y and label values.

Parameters:
dataX - X value
dataY - Y value
str - Label
individual - true if you want a unique color
g - This chart's Globals class

Datum

public Datum(int whichPoint,
             double dataY,
             java.lang.String str,
             Globals g)
Construct Datum with predictable color, initializes X, Y and label values.

Parameters:
whichPoint - implicit X value
dataY - Y value
str - Label
g - This chart's Globals class

Datum

public Datum(double dataX,
             double dataY,
             Globals g)
Constructs Datum with a default Gc, initializes X and Y values.

Parameters:
dataX - X value
dataY - Y value
g - This chart's Globals class

Datum

public Datum(double dataX,
             double dataY,
             boolean individual,
             Globals g)
Constructs Datum with unique color, initializes X and Y values.

Parameters:
dataX - X value
dataY - Y value
individual - true if you want a unique color
g - This chart's Globals class

Datum

public Datum(double dataY,
             java.lang.String str,
             int element,
             Globals g)
Constructs a Datum with a Gc based on this Datum's place within a Dataset. Also initializes a label and a Y value.

Parameters:
dataY - Value
str - Label
element - Element number
Method Detail

clone

public java.lang.Object clone()
Method

Returns:
java.lang.Object

getGc

public Gc getGc()
Returns this Datum's Gc

Returns:
this Datum's Gc

getGlobals

public Globals getGlobals()

getLabel

public java.lang.String getLabel()
Returns this Datum's label

Returns:
Label

getString

public java.lang.String getString()
Returns label, if it exists. Otherwise returns the string value of Y.

Returns:
Label or Y

getX

public double getX()
Returns value of X.

Returns:
Value of X

getY

public double getY()
Returns value of Y.

Returns:
Value of Y

getY2

public double getY2()
Returns value of Y2.

Returns:
Value of Y2

getY3

public double getY3()
Returns value of Y3.

Returns:
Value of Y3

setGc

public void setGc(Gc g)
Assigns a new Gc class to this Datum

Parameters:
g - new Gc class

setGlobals

public void setGlobals(Globals g)

setLabel

public void setLabel(java.lang.String s)
Sets this Datum's label to a new value.

Parameters:
s - Label

setX

public void setX(double d)
Sets X to a new value.

Parameters:
d - New value of X

setY

public void setY(double d)
Sets Y to a new value.

Parameters:
d - New value of Y

setY2

public void setY2(double d)
Sets Y2 to a new value.

Parameters:
d - New value of Y2

setY3

public void setY3(double d)
Sets Y3 to a new value.

Parameters:
d - New value of Y3

KavaChart 5.2.2 API