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 voidclear()clear the model.Objectclone()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;NumbergetValue(Comparable<?> series, Comparable<?> category)Get value of the specified series and category.voidremoveValue(Comparable<?> series, Comparable<?> category)remove the value of the specified series and category.voidsetValue(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:CategoryModelGet a series of the specified index;- Specified by:
getSeriesin interfaceCategoryModel
-
getCategory
public Comparable<?> getCategory(int index)
Description copied from interface:CategoryModelGet a category of the specified index;- Specified by:
getCategoryin interfaceCategoryModel
-
getSeries
public Collection<Comparable<?>> getSeries()
Description copied from interface:CategoryModelGet all series as a collection.- Specified by:
getSeriesin interfaceCategoryModel
-
getCategories
public Collection<Comparable<?>> getCategories()
Description copied from interface:CategoryModelGet categories of a specified series as a collection.- Specified by:
getCategoriesin interfaceCategoryModel
-
getKeys
public Collection<List<Comparable<?>>> getKeys()
Description copied from interface:CategoryModelGet (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:
getKeysin interfaceCategoryModel
-
getValue
public Number getValue(Comparable<?> series, Comparable<?> category)
Description copied from interface:CategoryModelGet value of the specified series and category.- Specified by:
getValuein interfaceCategoryModel- Parameters:
series- the seriescategory- the category.
-
setValue
public void setValue(Comparable<?> series, Comparable<?> category, Number value)
Description copied from interface:CategoryModeladd or update the value of a specified series and category.- Specified by:
setValuein interfaceCategoryModel- Parameters:
series- the seriescategory- the category.value- the value
-
removeValue
public void removeValue(Comparable<?> series, Comparable<?> category)
Description copied from interface:CategoryModelremove the value of the specified series and category.- Specified by:
removeValuein interfaceCategoryModel- Parameters:
series- the seriescategory- the category.
-
clear
public void clear()
Description copied from interface:CategoryModelclear the model.- Specified by:
clearin interfaceCategoryModel
-
clone
public Object clone()
- Overrides:
clonein classAbstractChartsModel
-
-