Package org.zkoss.chart.model
Class DefaultSingleValueCategoryModel
- java.lang.Object
-
- org.zkoss.chart.model.AbstractChartsModel
-
- org.zkoss.chart.model.DefaultSingleValueCategoryModel
-
- All Implemented Interfaces:
Serializable
,ChartsModel
,SingleValueCategoryModel
- Direct Known Subclasses:
DefaultLowModel
,DefaultPieModel
,DefaultWordCloudModel
public class DefaultSingleValueCategoryModel extends AbstractChartsModel implements SingleValueCategoryModel
A Pie chart data model implementation ofSingleValueCategoryModel
. SimpleSingleValueCategoryModel used by PieChart and FunnelChart is a series of (Category, singleValue) data objects.- Author:
- jumperchen
- See Also:
SingleValueCategoryModel
,Charts
, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.model.AbstractChartsModel
_listeners
-
-
Constructor Summary
Constructors Constructor Description DefaultSingleValueCategoryModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
clear the model.Object
clone()
Collection<Comparable<?>>
getCategories()
Get categories as a collection.Comparable<?>
getCategory(int index)
Get category of the specified index (0 based).Number
getValue(Comparable<?> category)
Get value of the specified category.void
removeValue(Comparable<?> category)
remove the value of the specified category.void
setValue(Comparable<?> category, Number value)
add or update the value of a specified category.-
Methods inherited from class org.zkoss.chart.model.AbstractChartsModel
addChartsDataListener, fireEvent, removeChartsDataListener
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.zkoss.chart.model.ChartsModel
addChartsDataListener, removeChartsDataListener
-
-
-
-
Method Detail
-
getCategory
public Comparable<?> getCategory(int index)
Description copied from interface:SingleValueCategoryModel
Get category of the specified index (0 based).- Specified by:
getCategory
in interfaceSingleValueCategoryModel
- Parameters:
index
- the index of the category.
-
getCategories
public Collection<Comparable<?>> getCategories()
Description copied from interface:SingleValueCategoryModel
Get categories as a collection.- Specified by:
getCategories
in interfaceSingleValueCategoryModel
-
getValue
public Number getValue(Comparable<?> category)
Description copied from interface:SingleValueCategoryModel
Get value of the specified category.- Specified by:
getValue
in interfaceSingleValueCategoryModel
- Parameters:
category
- the pie category.
-
setValue
public void setValue(Comparable<?> category, Number value)
Description copied from interface:SingleValueCategoryModel
add or update the value of a specified category.- Specified by:
setValue
in interfaceSingleValueCategoryModel
- Parameters:
category
- the pie category.value
- the pie value.
-
removeValue
public void removeValue(Comparable<?> category)
Description copied from interface:SingleValueCategoryModel
remove the value of the specified category.- Specified by:
removeValue
in interfaceSingleValueCategoryModel
- Parameters:
category
- the pie category.
-
clear
public void clear()
Description copied from interface:SingleValueCategoryModel
clear the model.- Specified by:
clear
in interfaceSingleValueCategoryModel
-
clone
public Object clone()
- Overrides:
clone
in classAbstractChartsModel
-
-