net.sf.clichart.chart
Class OptionsBean

java.lang.Object
  extended by net.sf.clichart.chart.OptionsBean
All Implemented Interfaces:
Options

public class OptionsBean
extends java.lang.Object
implements Options

A simple options Java bean, used for tests (?)

Author:
johnd

Field Summary
 
Fields inherited from interface net.sf.clichart.chart.Options
DATA_SEP_CSV, DATA_SEP_WHITE_SPACE, DEFAULT_COLUMN_INDEXES, DEFAULT_DATA_SEP, DEFAULT_DATE_FORMAT, DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_X_TYPE, X_TYPE_DATE_TIME, X_TYPE_NONE, X_TYPE_VALUE
 
Constructor Summary
OptionsBean()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 boolean forceSecondAxisYRange()
          If set, force use of the minimum and maximum Y values provided for the second axis
 void forceSecondAxisYRange(boolean forceSecondAxisYRange)
           
 boolean forceYRange()
          If set, force use of the minimum and maximum Y values provided
 void forceYRange(boolean forceYRange)
           
 int getChartHeight()
          Return the height of the chart in pixels
 java.lang.String getChartTitle()
          Return the title for the graph, or null if not set
 int getChartWidth()
          Return the width of the chart in pixels
 java.lang.String getChartXAxisTitle()
          Return the title for the X axis, or null if not set
 int getChartXType()
          Return the type of X axis - date/time, value or none
 java.lang.String getChartYAxisTitle()
          Return the title for the y axis, or null if not set
 java.util.List<ColourOverride> getColourOverrides()
          Return any colour overrides set for columns (may be null)
 int[] getColumnIndexes()
          Return the list of column indexes required from the data provided
 int getDataSeparatorType()
          Returns the data separator (CSV)
 java.lang.String getDateFormat()
          Returns the date format string for parsing date/times
 java.lang.String getFileOutputPath()
          Path to which chart should be saved - null if should show in UI
 java.lang.String getInputPath()
          Return the input path to read data from, or null if should read from stdin
 int getLineWeight()
          Return required line weight for first axis, on a scale of 1 - 5
 int getListenPort()
          Return the port number on which the CLI server should listen.
 java.lang.Integer getMaxYValue()
          Return the max Y value for the chart, or null if not set
 java.lang.Integer getMinYValue()
          Return the min Y value for the chart, or null if not set
 java.lang.String getSecondAxisChartYAxisTitle()
          Return the title for the second y axis, or null if not set
 int[] getSecondAxisColumnIndexes()
          Return the list of column indexes required for the second axis (if any) from the data provided, or null if none
 int getSecondAxisLineWeight()
          Return required line weight for second axis, on a scale of 1 - 5
 java.lang.Integer getSecondAxisMaxYValue()
          Return the max Y value for the second axis for the chart, or null if not set
 java.lang.Integer getSecondAxisMinYValue()
          Return the min Y value for the second axis for the chart, or null if not set
 java.lang.String[] getSecondAxisSeriesTitles()
          Return the titles for each of the second Y axis data series, or null if not set
 java.lang.String[] getSeriesTitles()
          Return the titles for each of the first Y axis data series, or null if not set
 boolean hasDataPoints()
          Return true if line shapes should be rendered for the first axis
 int hashCode()
           
 boolean hasHeaderRow()
          Return true if the first row of the data is a header (this will be used for column titles)
 boolean hasSecondAxisDataPoints()
          Return true if line shapes should be rendered for the second axis
 boolean ignoreDuplicateValues()
          Return true if exceptions for adding duplicate X axis values should be swallowed (with an appropriate message)
 boolean ignoreEmptyColumns()
          Return true if empty column values in the data should be ignored (with an appropriate message)
 boolean ignoreMissingColumns()
          Return true if missing columns in the data should be ignored (with an appropriate message)
 boolean isBarChart()
          Return true if the main axis should be a bar chart, rather than X-Y
 boolean isCliServer()
          Return true if clichart should act as a CLI server, to be driven by a script
 boolean isSecondAxisBarChart()
          Return true if the second axis should be a bar chart, rather than X-Y
 void setBarChart(boolean barChart)
           
 void setChartHeight(int height)
           
 void setChartTitle(java.lang.String chartTitle)
           
 void setChartWidth(int width)
           
 void setChartXAxisTitle(java.lang.String chartXAxisTitle)
           
 void setChartXType(int chartXType)
           
 void setChartYAxisTitle(java.lang.String chartYAxisTitle)
           
 void setCliServer(boolean cliServer)
           
 void setColourOverrides(java.util.List<ColourOverride> colourOverrides)
           
 void setColumnIndexes(int[] columnIndexes)
           
 void setDataPoints(boolean dataPoints)
           
 void setDataSeparatorType(int dataSeparatorType)
           
 void setDateFormat(java.lang.String dateFormat)
           
 void setFileOutputPath(java.lang.String fileOutputPath)
           
 void setHeaderRow(boolean hasHeaderRow)
           
 void setIgnoreDuplicateValues(boolean ignoreDuplicateValues)
           
 void setIgnoreEmptyColumns(boolean ignoreEmptyColumns)
           
 void setIgnoreMissingColumns(boolean ignoreMissingColumns)
           
 void setInputPath(java.lang.String inputPath)
           
 void setLineWeight(int lineWeight)
           
 void setListenPort(int port)
           
 void setMaxYValue(java.lang.Integer maxYValue)
           
 void setMinYValue(java.lang.Integer minYValue)
           
 void setSecondAxisBarChart(boolean secondAxisBarChart)
           
 void setSecondAxisChartYAxisTitle(java.lang.String secondAxisChartYAxisTitle)
           
 void setSecondAxisColumnIndexes(int[] secondAxisColumnIndexes)
           
 void setSecondAxisDataPoints(boolean secondAxisDataPoints)
           
 void setSecondAxisLineWeight(int secondAxisLineWeight)
           
 void setSecondAxisMaxYValue(java.lang.Integer secondAxisMaxYValue)
           
 void setSecondAxisMinYValue(java.lang.Integer secondAxisMinYValue)
           
 void setSecondAxisSeriesTitles(java.lang.String[] secondAxisSeriesTitles)
           
 void setSeriesTitles(java.lang.String[] seriesTitles)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionsBean

public OptionsBean()
Method Detail

getDataSeparatorType

public int getDataSeparatorType()
Description copied from interface: Options
Returns the data separator (CSV)

Specified by:
getDataSeparatorType in interface Options
Returns:
one of the DATA_SEP_* defines

setDataSeparatorType

public void setDataSeparatorType(int dataSeparatorType)

getDateFormat

public java.lang.String getDateFormat()
Description copied from interface: Options
Returns the date format string for parsing date/times

Specified by:
getDateFormat in interface Options

setDateFormat

public void setDateFormat(java.lang.String dateFormat)

hasHeaderRow

public boolean hasHeaderRow()
Description copied from interface: Options
Return true if the first row of the data is a header (this will be used for column titles)

Specified by:
hasHeaderRow in interface Options

setHeaderRow

public void setHeaderRow(boolean hasHeaderRow)

ignoreMissingColumns

public boolean ignoreMissingColumns()
Description copied from interface: Options
Return true if missing columns in the data should be ignored (with an appropriate message)

Specified by:
ignoreMissingColumns in interface Options

setIgnoreMissingColumns

public void setIgnoreMissingColumns(boolean ignoreMissingColumns)

ignoreEmptyColumns

public boolean ignoreEmptyColumns()
Description copied from interface: Options
Return true if empty column values in the data should be ignored (with an appropriate message)

Specified by:
ignoreEmptyColumns in interface Options

setIgnoreEmptyColumns

public void setIgnoreEmptyColumns(boolean ignoreEmptyColumns)

ignoreDuplicateValues

public boolean ignoreDuplicateValues()
Description copied from interface: Options
Return true if exceptions for adding duplicate X axis values should be swallowed (with an appropriate message)

Specified by:
ignoreDuplicateValues in interface Options

setIgnoreDuplicateValues

public void setIgnoreDuplicateValues(boolean ignoreDuplicateValues)

getColumnIndexes

public int[] getColumnIndexes()
Description copied from interface: Options
Return the list of column indexes required from the data provided

Specified by:
getColumnIndexes in interface Options

setColumnIndexes

public void setColumnIndexes(int[] columnIndexes)

getSecondAxisColumnIndexes

public int[] getSecondAxisColumnIndexes()
Description copied from interface: Options
Return the list of column indexes required for the second axis (if any) from the data provided, or null if none

Specified by:
getSecondAxisColumnIndexes in interface Options

setSecondAxisColumnIndexes

public void setSecondAxisColumnIndexes(int[] secondAxisColumnIndexes)

getChartXType

public int getChartXType()
Description copied from interface: Options
Return the type of X axis - date/time, value or none

Specified by:
getChartXType in interface Options
Returns:
one of the X_TYPE_* defines

setChartXType

public void setChartXType(int chartXType)

getFileOutputPath

public java.lang.String getFileOutputPath()
Description copied from interface: Options
Path to which chart should be saved - null if should show in UI

Specified by:
getFileOutputPath in interface Options

setFileOutputPath

public void setFileOutputPath(java.lang.String fileOutputPath)

getChartTitle

public java.lang.String getChartTitle()
Description copied from interface: Options
Return the title for the graph, or null if not set

Specified by:
getChartTitle in interface Options

setChartTitle

public void setChartTitle(java.lang.String chartTitle)

getChartXAxisTitle

public java.lang.String getChartXAxisTitle()
Description copied from interface: Options
Return the title for the X axis, or null if not set

Specified by:
getChartXAxisTitle in interface Options

setChartXAxisTitle

public void setChartXAxisTitle(java.lang.String chartXAxisTitle)

getChartYAxisTitle

public java.lang.String getChartYAxisTitle()
Description copied from interface: Options
Return the title for the y axis, or null if not set

Specified by:
getChartYAxisTitle in interface Options

setChartYAxisTitle

public void setChartYAxisTitle(java.lang.String chartYAxisTitle)

getSecondAxisChartYAxisTitle

public java.lang.String getSecondAxisChartYAxisTitle()
Description copied from interface: Options
Return the title for the second y axis, or null if not set

Specified by:
getSecondAxisChartYAxisTitle in interface Options

setSecondAxisChartYAxisTitle

public void setSecondAxisChartYAxisTitle(java.lang.String secondAxisChartYAxisTitle)

getMaxYValue

public java.lang.Integer getMaxYValue()
Description copied from interface: Options
Return the max Y value for the chart, or null if not set

Specified by:
getMaxYValue in interface Options

setMaxYValue

public void setMaxYValue(java.lang.Integer maxYValue)

getMinYValue

public java.lang.Integer getMinYValue()
Description copied from interface: Options
Return the min Y value for the chart, or null if not set

Specified by:
getMinYValue in interface Options

setMinYValue

public void setMinYValue(java.lang.Integer minYValue)

getSecondAxisMinYValue

public java.lang.Integer getSecondAxisMinYValue()
Description copied from interface: Options
Return the min Y value for the second axis for the chart, or null if not set

Specified by:
getSecondAxisMinYValue in interface Options

setSecondAxisMinYValue

public void setSecondAxisMinYValue(java.lang.Integer secondAxisMinYValue)

forceYRange

public boolean forceYRange()
Description copied from interface: Options
If set, force use of the minimum and maximum Y values provided

Specified by:
forceYRange in interface Options

forceYRange

public void forceYRange(boolean forceYRange)

forceSecondAxisYRange

public boolean forceSecondAxisYRange()
Description copied from interface: Options
If set, force use of the minimum and maximum Y values provided for the second axis

Specified by:
forceSecondAxisYRange in interface Options

forceSecondAxisYRange

public void forceSecondAxisYRange(boolean forceSecondAxisYRange)

getSecondAxisMaxYValue

public java.lang.Integer getSecondAxisMaxYValue()
Description copied from interface: Options
Return the max Y value for the second axis for the chart, or null if not set

Specified by:
getSecondAxisMaxYValue in interface Options

setSecondAxisMaxYValue

public void setSecondAxisMaxYValue(java.lang.Integer secondAxisMaxYValue)

getInputPath

public java.lang.String getInputPath()
Description copied from interface: Options
Return the input path to read data from, or null if should read from stdin

Specified by:
getInputPath in interface Options

setInputPath

public void setInputPath(java.lang.String inputPath)

getChartWidth

public int getChartWidth()
Description copied from interface: Options
Return the width of the chart in pixels

Specified by:
getChartWidth in interface Options

setChartWidth

public void setChartWidth(int width)

getChartHeight

public int getChartHeight()
Description copied from interface: Options
Return the height of the chart in pixels

Specified by:
getChartHeight in interface Options

setChartHeight

public void setChartHeight(int height)

isBarChart

public boolean isBarChart()
Description copied from interface: Options
Return true if the main axis should be a bar chart, rather than X-Y

Specified by:
isBarChart in interface Options

setBarChart

public void setBarChart(boolean barChart)

isSecondAxisBarChart

public boolean isSecondAxisBarChart()
Description copied from interface: Options
Return true if the second axis should be a bar chart, rather than X-Y

Specified by:
isSecondAxisBarChart in interface Options

setSecondAxisBarChart

public void setSecondAxisBarChart(boolean secondAxisBarChart)

getLineWeight

public int getLineWeight()
Description copied from interface: Options
Return required line weight for first axis, on a scale of 1 - 5

Specified by:
getLineWeight in interface Options

setLineWeight

public void setLineWeight(int lineWeight)

getSecondAxisLineWeight

public int getSecondAxisLineWeight()
Description copied from interface: Options
Return required line weight for second axis, on a scale of 1 - 5

Specified by:
getSecondAxisLineWeight in interface Options

setSecondAxisLineWeight

public void setSecondAxisLineWeight(int secondAxisLineWeight)

hasDataPoints

public boolean hasDataPoints()
Description copied from interface: Options
Return true if line shapes should be rendered for the first axis

Specified by:
hasDataPoints in interface Options

setDataPoints

public void setDataPoints(boolean dataPoints)

hasSecondAxisDataPoints

public boolean hasSecondAxisDataPoints()
Description copied from interface: Options
Return true if line shapes should be rendered for the second axis

Specified by:
hasSecondAxisDataPoints in interface Options

setSecondAxisDataPoints

public void setSecondAxisDataPoints(boolean secondAxisDataPoints)

getSeriesTitles

public java.lang.String[] getSeriesTitles()
Description copied from interface: Options
Return the titles for each of the first Y axis data series, or null if not set

Specified by:
getSeriesTitles in interface Options

setSeriesTitles

public void setSeriesTitles(java.lang.String[] seriesTitles)

getSecondAxisSeriesTitles

public java.lang.String[] getSecondAxisSeriesTitles()
Description copied from interface: Options
Return the titles for each of the second Y axis data series, or null if not set

Specified by:
getSecondAxisSeriesTitles in interface Options

setSecondAxisSeriesTitles

public void setSecondAxisSeriesTitles(java.lang.String[] secondAxisSeriesTitles)

isCliServer

public boolean isCliServer()
Description copied from interface: Options
Return true if clichart should act as a CLI server, to be driven by a script

Specified by:
isCliServer in interface Options

setCliServer

public void setCliServer(boolean cliServer)

getColourOverrides

public java.util.List<ColourOverride> getColourOverrides()
Description copied from interface: Options
Return any colour overrides set for columns (may be null)

Specified by:
getColourOverrides in interface Options

setColourOverrides

public void setColourOverrides(java.util.List<ColourOverride> colourOverrides)

getListenPort

public int getListenPort()
Description copied from interface: Options
Return the port number on which the CLI server should listen. If not greater than 0, functions as a true CLI server, i.e. listens on stdin and writes to stdout

Specified by:
getListenPort in interface Options

setListenPort

public void setListenPort(int port)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object