01: /* CategoryModel.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Aug 14 10:25:14 2006, Created by henrichen
10: }}IS_NOTE
11:
12: Copyright (C) 2006 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zul;
20:
21: import java.util.Collection;
22:
23: /**
24: * A catetory chart data model.
25: *
26: * @author henrichen
27: * @see Chart
28: * @see SimpleCategoryModel
29: */
30: public interface CategoryModel extends ChartModel {
31: /**
32: * Get a series of the specified index;
33: */
34: public Comparable getSeries(int index);
35:
36: /**
37: * Get a category of the specified index;
38: */
39: public Comparable getCategory(int index);
40:
41: /**
42: * Get all series as a collection.
43: */
44: public Collection getSeries();
45:
46: /**
47: * Get categories of a specified series as a collection.
48: */
49: public Collection getCategories();
50:
51: /**
52: * Get (series, category) pairs of this chart data model. The returned
53: * value is a collection of List where list.get(0) is the
54: * series, list.get(1) is the category, in the order the {@link #setValue} is
55: * called.
56: */
57: public Collection getKeys();
58:
59: /**
60: * Get value of the specified series and category.
61: * @param series the series
62: * @param category the category.
63: */
64: public Number getValue(Comparable series, Comparable category);
65:
66: /**
67: * add or update the value of a specified series and category.
68: * @param series the series
69: * @param category the category.
70: * @param value the value
71: */
72: public void setValue(Comparable series, Comparable category,
73: Number value);
74:
75: /**
76: * remove the value of the specified series and category.
77: * @param series the series
78: * @param category the category.
79: */
80: public void removeValue(Comparable series, Comparable category);
81:
82: /**
83: * clear the model.
84: */
85: public void clear();
86: }
|