Package org.zkoss.chart.model
Class DefaultFromToModel
- java.lang.Object
-
- org.zkoss.chart.model.AbstractChartsModel
-
- org.zkoss.chart.model.DefaultFromToModel
-
- All Implemented Interfaces:
Serializable
,ChartsModel
,FromToModel
- Direct Known Subclasses:
DefaultFromToWeightModel
public class DefaultFromToModel extends AbstractChartsModel implements FromToModel
A default implementation ofFromToModel
. A FromTo model is an N series of (from, to) data objects.- Since:
- 7.2.1.0
- Author:
- rudyhuang
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DefaultFromToModel.FromToPair
-
Field Summary
Fields Modifier and Type Field Description protected List<Comparable<?>>
_seriesList
protected Map<Comparable<?>,List<DefaultFromToModel.FromToPair>>
_seriesMap
-
Fields inherited from class org.zkoss.chart.model.AbstractChartsModel
_listeners
-
-
Constructor Summary
Constructors Constructor Description DefaultFromToModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addValue(Comparable<?> series, String from, String to)
Append a (from, to) into a series.void
addValue(Comparable<?> series, String from, String to, int index)
Add a (from, to) into a series at specified index.void
clear()
clear this model.Object
clone()
int
getDataCount(Comparable<?> series)
Get data count of a specified series.String
getFrom(Comparable<?> series, int index)
Get from value of a specified series and data index.Collection<Comparable<?>>
getSeries()
Get all series as a collection.Comparable<?>
getSeries(int index)
Get a series of the specified index;String
getTo(Comparable<?> series, int index)
Get to value of a specified series and data index.boolean
isAutoSort()
Deprecated.void
removeSeries(Comparable<?> series)
/** Remove data of a specified series.void
removeValue(Comparable<?> series, int index)
Remove (from, to) value of a specified series and data index.void
setAutoSort(boolean auto)
Deprecated.void
setValue(Comparable<?> series, String from, String to, int index)
Replace the value of the new (from, to) into a series at specified index.-
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
-
-
-
-
Field Detail
-
_seriesMap
protected Map<Comparable<?>,List<DefaultFromToModel.FromToPair>> _seriesMap
-
_seriesList
protected List<Comparable<?>> _seriesList
-
-
Method Detail
-
getSeries
public Comparable<?> getSeries(int index)
Description copied from interface:FromToModel
Get a series of the specified index;- Specified by:
getSeries
in interfaceFromToModel
-
getSeries
public Collection<Comparable<?>> getSeries()
Description copied from interface:FromToModel
Get all series as a collection.- Specified by:
getSeries
in interfaceFromToModel
-
getDataCount
public int getDataCount(Comparable<?> series)
Description copied from interface:FromToModel
Get data count of a specified series.- Specified by:
getDataCount
in interfaceFromToModel
- Parameters:
series
- the specified series.
-
getFrom
public String getFrom(Comparable<?> series, int index)
Description copied from interface:FromToModel
Get from value of a specified series and data index.- Specified by:
getFrom
in interfaceFromToModel
- Parameters:
series
- the series.index
- the data index.
-
getTo
public String getTo(Comparable<?> series, int index)
Description copied from interface:FromToModel
Get to value of a specified series and data index.- Specified by:
getTo
in interfaceFromToModel
- Parameters:
series
- the series.index
- the data index.
-
setValue
public void setValue(Comparable<?> series, String from, String to, int index)
Description copied from interface:FromToModel
Replace the value of the new (from, to) into a series at specified index.- Specified by:
setValue
in interfaceFromToModel
- Parameters:
series
- the series.from
- the from value.to
- the to value.index
- the data index.
-
addValue
public void addValue(Comparable<?> series, String from, String to)
Description copied from interface:FromToModel
Append a (from, to) into a series.- Specified by:
addValue
in interfaceFromToModel
- Parameters:
series
- the series.from
- the from value.to
- the to value.
-
addValue
public void addValue(Comparable<?> series, String from, String to, int index)
Description copied from interface:FromToModel
Add a (from, to) into a series at specified index.- Specified by:
addValue
in interfaceFromToModel
- Parameters:
series
- the series.from
- the from value.to
- the to value.index
- the data index.
-
setAutoSort
@Deprecated public void setAutoSort(boolean auto)
Deprecated.Description copied from interface:FromToModel
Set model to autosort on x value for each series.- Specified by:
setAutoSort
in interfaceFromToModel
-
isAutoSort
@Deprecated public boolean isAutoSort()
Deprecated.Description copied from interface:FromToModel
check whether to autosort on x value for each series; default is true.- Specified by:
isAutoSort
in interfaceFromToModel
-
removeSeries
public void removeSeries(Comparable<?> series)
Description copied from interface:FromToModel
/** Remove data of a specified series.- Specified by:
removeSeries
in interfaceFromToModel
- Parameters:
series
- the series
-
removeValue
public void removeValue(Comparable<?> series, int index)
Description copied from interface:FromToModel
Remove (from, to) value of a specified series and data index.- Specified by:
removeValue
in interfaceFromToModel
- Parameters:
series
- the series.index
- the data index.
-
clear
public void clear()
Description copied from interface:FromToModel
clear this model.- Specified by:
clear
in interfaceFromToModel
-
clone
public Object clone()
- Overrides:
clone
in classAbstractChartsModel
-
-