Package org.zkoss.chart.model
Class DefaultCategoryModel
- java.lang.Object
-
- org.zkoss.chart.model.AbstractChartsModel
-
- org.zkoss.chart.model.DefaultCategoryModel
-
- All Implemented Interfaces:
Serializable
,CategoryModel
,ChartsModel
public class DefaultCategoryModel extends AbstractChartsModel implements CategoryModel
A Category data model implementation ofCategoryModel
. A Category model is an N series of (category, value) data objects.- Author:
- jumperchen
- See Also:
CategoryModel
,Charts
, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.model.AbstractChartsModel
_listeners
-
-
Constructor Summary
Constructors Constructor Description DefaultCategoryModel()
-
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 of a specified series as a collection.Comparable<?>
getCategory(int index)
Get a category of the specified index;Collection<List<Comparable<?>>>
getKeys()
Get (series, category) pairs of this chart data model.Collection<Comparable<?>>
getSeries()
Get all series as a collection.Comparable<?>
getSeries(int index)
Get a series of the specified index;Number
getValue(Comparable<?> series, Comparable<?> category)
Get value of the specified series and category.void
removeValue(Comparable<?> series, Comparable<?> category)
remove the value of the specified series and category.void
setValue(Comparable<?> series, Comparable<?> category, Number value)
add or update the value of a specified series and 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
-
getSeries
public Comparable<?> getSeries(int index)
Description copied from interface:CategoryModel
Get a series of the specified index;- Specified by:
getSeries
in interfaceCategoryModel
-
getCategory
public Comparable<?> getCategory(int index)
Description copied from interface:CategoryModel
Get a category of the specified index;- Specified by:
getCategory
in interfaceCategoryModel
-
getSeries
public Collection<Comparable<?>> getSeries()
Description copied from interface:CategoryModel
Get all series as a collection.- Specified by:
getSeries
in interfaceCategoryModel
-
getCategories
public Collection<Comparable<?>> getCategories()
Description copied from interface:CategoryModel
Get categories of a specified series as a collection.- Specified by:
getCategories
in interfaceCategoryModel
-
getKeys
public Collection<List<Comparable<?>>> getKeys()
Description copied from interface:CategoryModel
Get (series, category) pairs of this chart data model. The returned value is a collection of List where list.get(0) is the series, list.get(1) is the category, in the order theCategoryModel.setValue(java.lang.Comparable<?>, java.lang.Comparable<?>, java.lang.Number)
is called.- Specified by:
getKeys
in interfaceCategoryModel
-
getValue
public Number getValue(Comparable<?> series, Comparable<?> category)
Description copied from interface:CategoryModel
Get value of the specified series and category.- Specified by:
getValue
in interfaceCategoryModel
- Parameters:
series
- the seriescategory
- the category.
-
setValue
public void setValue(Comparable<?> series, Comparable<?> category, Number value)
Description copied from interface:CategoryModel
add or update the value of a specified series and category.- Specified by:
setValue
in interfaceCategoryModel
- Parameters:
series
- the seriescategory
- the category.value
- the value
-
removeValue
public void removeValue(Comparable<?> series, Comparable<?> category)
Description copied from interface:CategoryModel
remove the value of the specified series and category.- Specified by:
removeValue
in interfaceCategoryModel
- Parameters:
series
- the seriescategory
- the category.
-
clear
public void clear()
Description copied from interface:CategoryModel
clear the model.- Specified by:
clear
in interfaceCategoryModel
-
clone
public Object clone()
- Overrides:
clone
in classAbstractChartsModel
-
-