org.silverpeas.chart
Class AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE extends AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>>

java.lang.Object
  extended by org.silverpeas.chart.AbstractChartItem<ITEM_TYPE>
      extended by org.silverpeas.chart.AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>
All Implemented Interfaces:
ChartItem
Direct Known Subclasses:
PeriodChartItem

public abstract class AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE extends AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>>
extends AbstractChartItem<ITEM_TYPE>

Author:
Yohann Chastagnier

Constructor Summary
protected AbstractAxisChartItem(XAXIS_DATA_TYPE x)
           
 
Method Summary
 ITEM_TYPE add(YAXIS_DATA_TYPE y)
          Add a y value associated to the x one.
protected  void computeDataAsJson(org.json.JSONObject itemAsJson)
          Computes the data of the item into a JSON representation.
protected abstract  org.json.JSONObject computeXAsJson(XAXIS_DATA_TYPE xValue)
          Computes the data of the x value into a JSON representation.
protected abstract
<T> T
computeYValueAsJson(YAXIS_DATA_TYPE yValue)
          Computes the data of a y value into a JSON representation.
 XAXIS_DATA_TYPE getX()
          Gets the data of x axis.
 List<YAXIS_DATA_TYPE> getYValues()
          Gets the value
 
Methods inherited from class org.silverpeas.chart.AbstractChartItem
addExtra, asJson, getExtra, getTitle, withTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAxisChartItem

protected AbstractAxisChartItem(XAXIS_DATA_TYPE x)
Method Detail

getX

public XAXIS_DATA_TYPE getX()
Gets the data of x axis.

Returns:

getYValues

public List<YAXIS_DATA_TYPE> getYValues()
Gets the value

Returns:

add

public ITEM_TYPE add(YAXIS_DATA_TYPE y)
Add a y value associated to the x one.

Parameters:
y - the value to add
Returns:
the instance of the chart item itself.

computeDataAsJson

protected void computeDataAsJson(org.json.JSONObject itemAsJson)
Description copied from class: AbstractChartItem
Computes the data of the item into a JSON representation.

Specified by:
computeDataAsJson in class AbstractChartItem<ITEM_TYPE extends AbstractAxisChartItem<XAXIS_DATA_TYPE,YAXIS_DATA_TYPE,ITEM_TYPE>>

computeXAsJson

protected abstract org.json.JSONObject computeXAsJson(XAXIS_DATA_TYPE xValue)
Computes the data of the x value into a JSON representation.

Parameters:
xValue - the value on x axis.

computeYValueAsJson

protected abstract <T> T computeYValueAsJson(YAXIS_DATA_TYPE yValue)
Computes the data of a y value into a JSON representation.

Parameters:
yValue - a y value from getYValues().


Copyright © 2016 Silverpeas. All Rights Reserved.