|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.corpstein.image.ChartData
public class ChartData
Encapsulates the data (data points, labels, title, etc) needed to create
a chart using ChartFactory
.
Constructor Summary | |
---|---|
ChartData()
Sole constructor. |
Method Summary | |
---|---|
void |
addKeyLabel(java.lang.String label)
Adds the specified label to the list of key labels |
void |
addLabel(java.lang.String label)
Adds the specified label to the list of labels |
void |
addPoint(java.lang.String label,
double value)
Adds the specified label-value pair to the list of points, converting the double value to a Double object |
void |
addPoint(java.lang.String label,
float value)
Adds the specified label-value pair to the list of points, converting the float value to a Double object |
void |
addPoint(java.lang.String label,
int value)
Adds the specified label-value pair to the list of points, converting the int value to a Double object |
void |
addPoint(java.lang.String label,
java.lang.Number value)
Adds the specified label-value pair to the list of points, converting the Number value to a Double object |
void |
addValue(double value)
Adds the specified value, converting the double to a Double |
void |
addValue(float value)
Adds the specified value, converting the float to a Double |
void |
addValue(int value)
Adds the specified value, converting the int to a Double |
void |
addValue(java.lang.Number value)
Adds the specified value, converting the Number to a Double |
java.lang.String |
getKeyLabel(int index)
Returns the key label based on the specified index |
java.lang.String |
getLabel(int index)
Returns the label based on the specified index |
double |
getMaximumValue()
Returns the maximum value that the ChartData object contains as a double |
java.lang.String |
getTitle()
Returns the title String |
int |
getTotalColumns()
Returns the total number of columns defined in the ChartData object |
int |
getTotalKeys()
Returns the total number of keys defined in the ChartData object |
double |
getTotalValue()
Returns the total of all of the calues defined in the ChartData object |
int |
getTotalValues()
Returns the total number of values defined in the ChartData object |
int |
getTotalValuesPerColumn()
Returns the total number of values per columns defined in the ChartData object |
double |
getValue(int index)
Returns the value stored at the specified index |
void |
setKeyLabel(int index,
java.lang.String text)
Sets the key label String at the specified index |
void |
setLabel(int index,
java.lang.String text)
Sets the label String at the specified index |
void |
setTitle(java.lang.String title)
Sets the title String to the specified text |
java.lang.String |
toString()
Creates and returns a String describing all of the contents of the ChartData object for debugging use |
void |
validate()
Called before the ChartData object is used to create a chart. |
void |
validateColumns()
Sets the total values per column and checks to make sure that the number of values and labels match. |
void |
validateKeys()
Checks to make sure the number of values per column matches the number of key labels |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChartData()
Method Detail |
---|
public void addKeyLabel(java.lang.String label)
label
- The key label to addpublic void addLabel(java.lang.String label)
label
- The label to addpublic void addPoint(java.lang.String label, double value) throws java.lang.IllegalStateException
label
- The point's labelvalue
- The point's double value
java.lang.IllegalStateException
public void addPoint(java.lang.String label, int value)
label
- The point's labelvalue
- The point's int valuepublic void addPoint(java.lang.String label, float value)
label
- The point's labelvalue
- The point's float valuepublic void addPoint(java.lang.String label, java.lang.Number value)
label
- The point's labelvalue
- The point's Number valuepublic void addValue(double value)
value
- The double valuepublic void addValue(int value)
value
- The int valuepublic void addValue(float value)
value
- The float valuepublic void addValue(java.lang.Number value)
value
- The Number valuepublic java.lang.String getKeyLabel(int index)
index
- The index of the key label
public java.lang.String getLabel(int index)
index
- The index of the label
public double getMaximumValue()
public java.lang.String getTitle()
public int getTotalColumns()
public int getTotalKeys()
public double getTotalValue()
public int getTotalValues()
public int getTotalValuesPerColumn()
public double getValue(int index)
public void setKeyLabel(int index, java.lang.String text)
index
- The index of the key label to settext
- The String to set the key label to
java.lang.IllegalArgumentException
- if the text parameter is nullpublic void setLabel(int index, java.lang.String text)
index
- The index of the label to settext
- The String to set the label to
java.lang.IllegalArgumentException
- if the text parameter is nullpublic void setTitle(java.lang.String title)
title
- The String to set the title to
java.lang.IllegalArgumentException
- if the title parameter is nullpublic java.lang.String toString()
toString
in class java.lang.Object
public void validate()
public void validateKeys()
java.lang.IllegalStateException
- if the number of values per column does
not match the number of key labelspublic void validateColumns() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the total labels and values do not
match
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |