Package org.zkoss.zul
Class SimpleXYModel
- java.lang.Object
-
- org.zkoss.zul.AbstractChartModel
-
- org.zkoss.zul.SimpleXYModel
-
- All Implemented Interfaces:
java.io.Serializable
,ChartModel
,XYModel
- Direct Known Subclasses:
SimpleXYZModel
public class SimpleXYModel extends AbstractChartModel implements XYModel
A XY data model implementation ofXYModel
. A XY model is an N series of (X, Y) data objects .- Author:
- henrichen
- See Also:
XYModel
,Chart
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SimpleXYModel.XYPair
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.Comparable<?>>
_seriesList
protected java.util.Map<java.lang.Comparable<?>,java.util.List<SimpleXYModel.XYPair>>
_seriesMap
-
Fields inherited from class org.zkoss.zul.AbstractChartModel
_listeners
-
-
Constructor Summary
Constructors Constructor Description SimpleXYModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(java.lang.Comparable<?> series, java.lang.Number x, java.lang.Number y)
Append an (x,y) into a series.void
addValue(java.lang.Comparable<?> series, java.lang.Number x, java.lang.Number y, int index)
Add an (x,y) into a series at specified index.void
clear()
clear this model.java.lang.Object
clone()
int
getDataCount(java.lang.Comparable<?> series)
Get data count of a specified series.java.util.Collection<java.lang.Comparable<?>>
getSeries()
Get all series as a collection.java.lang.Comparable<?>
getSeries(int index)
Get a series of the specified index;java.lang.Number
getX(java.lang.Comparable<?> series, int index)
Get X value of a specified series and data index.java.lang.Number
getY(java.lang.Comparable<?> series, int index)
Get Y value of a specified series and data index.boolean
isAutoSort()
check whether to autosort on x value for each series; default is true.void
removeSeries(java.lang.Comparable<?> series)
Remove data of a specified series.void
removeValue(java.lang.Comparable<?> series, int index)
Remove (x,y) value of a specified series and data index.void
setAutoSort(boolean auto)
Set model to autosort on x value for each series.void
setValue(java.lang.Comparable<?> series, java.lang.Number x, java.lang.Number y, int index)
Replace the value of the new (x,y) into a series at specified index.-
Methods inherited from class org.zkoss.zul.AbstractChartModel
addChartDataListener, fireEvent, removeChartDataListener
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.zkoss.zul.ChartModel
addChartDataListener, removeChartDataListener
-
-
-
-
Field Detail
-
_seriesMap
protected java.util.Map<java.lang.Comparable<?>,java.util.List<SimpleXYModel.XYPair>> _seriesMap
-
_seriesList
protected java.util.List<java.lang.Comparable<?>> _seriesList
-
-
Method Detail
-
getSeries
public java.lang.Comparable<?> getSeries(int index)
Description copied from interface:XYModel
Get a series of the specified index;
-
getSeries
public java.util.Collection<java.lang.Comparable<?>> getSeries()
Description copied from interface:XYModel
Get all series as a collection.
-
getDataCount
public int getDataCount(java.lang.Comparable<?> series)
Description copied from interface:XYModel
Get data count of a specified series.- Specified by:
getDataCount
in interfaceXYModel
- Parameters:
series
- the specified series.
-
getX
public java.lang.Number getX(java.lang.Comparable<?> series, int index)
Description copied from interface:XYModel
Get X value of a specified series and data index.
-
getY
public java.lang.Number getY(java.lang.Comparable<?> series, int index)
Description copied from interface:XYModel
Get Y value of a specified series and data index.
-
setValue
public void setValue(java.lang.Comparable<?> series, java.lang.Number x, java.lang.Number y, int index)
Description copied from interface:XYModel
Replace the value of the new (x,y) into a series at specified index.
-
addValue
public void addValue(java.lang.Comparable<?> series, java.lang.Number x, java.lang.Number y)
Description copied from interface:XYModel
Append an (x,y) into a series.
-
addValue
public void addValue(java.lang.Comparable<?> series, java.lang.Number x, java.lang.Number y, int index)
Description copied from interface:XYModel
Add an (x,y) into a series at specified index.
-
setAutoSort
public void setAutoSort(boolean auto)
Description copied from interface:XYModel
Set model to autosort on x value for each series.- Specified by:
setAutoSort
in interfaceXYModel
-
isAutoSort
public boolean isAutoSort()
Description copied from interface:XYModel
check whether to autosort on x value for each series; default is true.- Specified by:
isAutoSort
in interfaceXYModel
-
removeSeries
public void removeSeries(java.lang.Comparable<?> series)
Description copied from interface:XYModel
Remove data of a specified series.- Specified by:
removeSeries
in interfaceXYModel
- Parameters:
series
- the series
-
removeValue
public void removeValue(java.lang.Comparable<?> series, int index)
Description copied from interface:XYModel
Remove (x,y) value of a specified series and data index.- Specified by:
removeValue
in interfaceXYModel
- Parameters:
series
- the series.index
- the data index.
-
clear
public void clear()
Description copied from interface:XYModel
clear this model.
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classAbstractChartModel
-
-