Java Doc for TimeSeries.java in  » Chart » jfreechart » org » jfree » data » time » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Chart » jfreechart » org.jfree.data.time 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jfree.data.general.Series
      org.jfree.data.time.TimeSeries

TimeSeries
public class TimeSeries extends Series implements Cloneable,Serializable(Code)
Represents a sequence of zero or more data items in the form (period, value).


Field Summary
final protected static  StringDEFAULT_DOMAIN_DESCRIPTION
     Default value for the domain description.
final protected static  StringDEFAULT_RANGE_DESCRIPTION
     Default value for the range description.
protected  Listdata
     The list of data items in the series.
protected  ClasstimePeriodClass
     The type of period for the data.

Constructor Summary
public  TimeSeries(String name)
     Creates a new (empty) time series.
public  TimeSeries(String name, Class timePeriodClass)
     Creates a new (empty) time series with the specified name and class of RegularTimePeriod .
public  TimeSeries(String name, String domain, String range, Class timePeriodClass)
     Creates a new time series that contains no data.

Descriptions can be specified for the domain and range.


Method Summary
public  voidadd(TimeSeriesDataItem item)
     Adds a data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
public  voidadd(TimeSeriesDataItem item, boolean notify)
     Adds a data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
public  voidadd(RegularTimePeriod period, double value)
     Adds a new data item to the series and sends a SeriesChangeEvent to all registered listeners.
public  voidadd(RegularTimePeriod period, double value, boolean notify)
     Adds a new data item to the series and sends a SeriesChangeEvent to all registered listeners.
public  voidadd(RegularTimePeriod period, Number value)
     Adds a new data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
public  voidadd(RegularTimePeriod period, Number value, boolean notify)
     Adds a new data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
public  TimeSeriesaddAndOrUpdate(TimeSeries series)
     Adds or updates data from one series to another.
public  TimeSeriesDataItemaddOrUpdate(RegularTimePeriod period, double value)
     Adds or updates an item in the times series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period to add/update (null not permitted).
Parameters:
  value - the new value.
public  TimeSeriesDataItemaddOrUpdate(RegularTimePeriod period, Number value)
     Adds or updates an item in the times series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period to add/update (null not permitted).
Parameters:
  value - the new value (null permitted).
public  voidclear()
     Removes all data items from the series and sends a SeriesChangeEvent to all registered listeners.
public  Objectclone()
     Returns a clone of the time series.
public  TimeSeriescreateCopy(int start, int end)
     Creates a new timeseries by copying a subset of the data in this time series.
Parameters:
  start - the index of the first time period to copy.
Parameters:
  end - the index of the last time period to copy.
public  TimeSeriescreateCopy(RegularTimePeriod start, RegularTimePeriod end)
     Creates a new timeseries by copying a subset of the data in this time series.
Parameters:
  start - the first time period to copy.
Parameters:
  end - the last time period to copy.
public  voiddelete(RegularTimePeriod period)
     Deletes the data item for the given time period and sends a SeriesChangeEvent to all registered listeners.
public  voiddelete(int start, int end)
     Deletes data from start until end index (end inclusive).
public  booleanequals(Object object)
     Tests the series for equality with an arbitrary object.
Parameters:
  object - the object to test against (null permitted).
public  TimeSeriesDataItemgetDataItem(int index)
     Returns a data item for the series.
Parameters:
  index - the item index (zero-based).
public  TimeSeriesDataItemgetDataItem(RegularTimePeriod period)
     Returns the data item for a specific period.
Parameters:
  period - the period of interest (null not allowed).
public  StringgetDomainDescription()
     Returns the domain description.
public  intgetIndex(RegularTimePeriod period)
     Returns the index for the item (if any) that corresponds to a time period.
Parameters:
  period - the time period (null not permitted).
public  intgetItemCount()
     Returns the number of items in the series.
public  ListgetItems()
     Returns the list of data items for the series (the list contains TimeSeriesDataItem objects and is unmodifiable).
public  longgetMaximumItemAge()
     Returns the maximum item age (in time periods) for the series.
public  intgetMaximumItemCount()
     Returns the maximum number of items that will be retained in the series.
public  RegularTimePeriodgetNextTimePeriod()
     Returns a time period that would be the next in sequence on the end of the time series.
public  StringgetRangeDescription()
     Returns the range description.
public  RegularTimePeriodgetTimePeriod(int index)
     Returns the time period at the specified index.
Parameters:
  index - the index of the data item.
public  ClassgetTimePeriodClass()
     Returns the time period class for this series.
public  CollectiongetTimePeriods()
     Returns a collection of all the time periods in the time series.
public  CollectiongetTimePeriodsUniqueToOtherSeries(TimeSeries series)
     Returns a collection of time periods in the specified series, but not in this series, and therefore unique to the specified series.
Parameters:
  series - the series to check against this one.
public  NumbergetValue(int index)
     Returns the value at the specified index.
Parameters:
  index - index of a value.
public  NumbergetValue(RegularTimePeriod period)
     Returns the value for a time period.
public  inthashCode()
     Returns a hash code value for the object.
public  voidremoveAgedItems(boolean notify)
     Age items in the series.
public  voidremoveAgedItems(long latest, boolean notify)
     Age items in the series.
public  voidsetDomainDescription(String description)
     Sets the domain description and sends a PropertyChangeEvent (with the property name Domain) to all registered property change listeners.
public  voidsetMaximumItemAge(long periods)
     Sets the number of time units in the 'history' for the series.
public  voidsetMaximumItemCount(int maximum)
     Sets the maximum number of items that will be retained in the series.
public  voidsetRangeDescription(String description)
     Sets the range description and sends a PropertyChangeEvent (with the property name Range) to all registered listeners.
public  voidupdate(RegularTimePeriod period, Number value)
     Updates (changes) the value for a time period.
public  voidupdate(int index, Number value)
     Updates (changes) the value of a data item.

Field Detail
DEFAULT_DOMAIN_DESCRIPTION
final protected static String DEFAULT_DOMAIN_DESCRIPTION(Code)
Default value for the domain description.



DEFAULT_RANGE_DESCRIPTION
final protected static String DEFAULT_RANGE_DESCRIPTION(Code)
Default value for the range description.



data
protected List data(Code)
The list of data items in the series.



timePeriodClass
protected Class timePeriodClass(Code)
The type of period for the data.




Constructor Detail
TimeSeries
public TimeSeries(String name)(Code)
Creates a new (empty) time series. By default, a daily time series is created. Use one of the other constructors if you require a different time period.
Parameters:
  name - the series name (null not permitted).



TimeSeries
public TimeSeries(String name, Class timePeriodClass)(Code)
Creates a new (empty) time series with the specified name and class of RegularTimePeriod .
Parameters:
  name - the series name (null not permitted).
Parameters:
  timePeriodClass - the type of time period (null not permitted).



TimeSeries
public TimeSeries(String name, String domain, String range, Class timePeriodClass)(Code)
Creates a new time series that contains no data.

Descriptions can be specified for the domain and range. One situation where this is helpful is when generating a chart for the time series - axis labels can be taken from the domain and range description.
Parameters:
  name - the name of the series (null not permitted).
Parameters:
  domain - the domain description (null permitted).
Parameters:
  range - the range description (null permitted).
Parameters:
  timePeriodClass - the type of time period (null not permitted).





Method Detail
add
public void add(TimeSeriesDataItem item)(Code)
Adds a data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  item - the (timeperiod, value) pair (null not permitted).



add
public void add(TimeSeriesDataItem item, boolean notify)(Code)
Adds a data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  item - the (timeperiod, value) pair (null not permitted).
Parameters:
  notify - notify listeners?



add
public void add(RegularTimePeriod period, double value)(Code)
Adds a new data item to the series and sends a SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period (null not permitted).
Parameters:
  value - the value.



add
public void add(RegularTimePeriod period, double value, boolean notify)(Code)
Adds a new data item to the series and sends a SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period (null not permitted).
Parameters:
  value - the value.
Parameters:
  notify - notify listeners?



add
public void add(RegularTimePeriod period, Number value)(Code)
Adds a new data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period (null not permitted).
Parameters:
  value - the value (null permitted).



add
public void add(RegularTimePeriod period, Number value, boolean notify)(Code)
Adds a new data item to the series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period (null not permitted).
Parameters:
  value - the value (null permitted).
Parameters:
  notify - notify listeners?



addAndOrUpdate
public TimeSeries addAndOrUpdate(TimeSeries series)(Code)
Adds or updates data from one series to another. Returns another series containing the values that were overwritten.
Parameters:
  series - the series to merge with this. A series containing the values that were overwritten.



addOrUpdate
public TimeSeriesDataItem addOrUpdate(RegularTimePeriod period, double value)(Code)
Adds or updates an item in the times series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period to add/update (null not permitted).
Parameters:
  value - the new value. A copy of the overwritten data item, or null if no item was overwritten.



addOrUpdate
public TimeSeriesDataItem addOrUpdate(RegularTimePeriod period, Number value)(Code)
Adds or updates an item in the times series and sends a org.jfree.data.general.SeriesChangeEvent to all registered listeners.
Parameters:
  period - the time period to add/update (null not permitted).
Parameters:
  value - the new value (null permitted). A copy of the overwritten data item, or null if no item was overwritten.



clear
public void clear()(Code)
Removes all data items from the series and sends a SeriesChangeEvent to all registered listeners.



clone
public Object clone() throws CloneNotSupportedException(Code)
Returns a clone of the time series.

Notes:

  • no need to clone the domain and range descriptions, since String object is immutable;
  • we pass over to the more general method clone(start, end).
A clone of the time series.
throws:
  CloneNotSupportedException - not thrown by this class, but subclasses may differ.



createCopy
public TimeSeries createCopy(int start, int end) throws CloneNotSupportedException(Code)
Creates a new timeseries by copying a subset of the data in this time series.
Parameters:
  start - the index of the first time period to copy.
Parameters:
  end - the index of the last time period to copy. A series containing a copy of this times series from start untilend.
throws:
  CloneNotSupportedException - if there is a cloning problem.



createCopy
public TimeSeries createCopy(RegularTimePeriod start, RegularTimePeriod end) throws CloneNotSupportedException(Code)
Creates a new timeseries by copying a subset of the data in this time series.
Parameters:
  start - the first time period to copy.
Parameters:
  end - the last time period to copy. A time series containing a copy of this time series from start until end.
throws:
  CloneNotSupportedException - if there is a cloning problem.



delete
public void delete(RegularTimePeriod period)(Code)
Deletes the data item for the given time period and sends a SeriesChangeEvent to all registered listeners. If there is no item with the specified time period, this method does nothing.
Parameters:
  period - the period of the item to delete (null not permitted).



delete
public void delete(int start, int end)(Code)
Deletes data from start until end index (end inclusive).
Parameters:
  start - the index of the first period to delete.
Parameters:
  end - the index of the last period to delete.



equals
public boolean equals(Object object)(Code)
Tests the series for equality with an arbitrary object.
Parameters:
  object - the object to test against (null permitted). A boolean.



getDataItem
public TimeSeriesDataItem getDataItem(int index)(Code)
Returns a data item for the series.
Parameters:
  index - the item index (zero-based). The data item.
See Also:   TimeSeries.getDataItem(RegularTimePeriod)



getDataItem
public TimeSeriesDataItem getDataItem(RegularTimePeriod period)(Code)
Returns the data item for a specific period.
Parameters:
  period - the period of interest (null not allowed). The data item matching the specified period (or null if there is no match).
See Also:   TimeSeries.getDataItem(int)



getDomainDescription
public String getDomainDescription()(Code)
Returns the domain description. The domain description (possibly null).
See Also:   TimeSeries.setDomainDescription(String)



getIndex
public int getIndex(RegularTimePeriod period)(Code)
Returns the index for the item (if any) that corresponds to a time period.
Parameters:
  period - the time period (null not permitted). The index.



getItemCount
public int getItemCount()(Code)
Returns the number of items in the series. The item count.



getItems
public List getItems()(Code)
Returns the list of data items for the series (the list contains TimeSeriesDataItem objects and is unmodifiable). The list of data items.



getMaximumItemAge
public long getMaximumItemAge()(Code)
Returns the maximum item age (in time periods) for the series. The maximum item age.
See Also:   TimeSeries.setMaximumItemAge(long)



getMaximumItemCount
public int getMaximumItemCount()(Code)
Returns the maximum number of items that will be retained in the series. The default value is Integer.MAX_VALUE. The maximum item count.
See Also:   TimeSeries.setMaximumItemCount(int)



getNextTimePeriod
public RegularTimePeriod getNextTimePeriod()(Code)
Returns a time period that would be the next in sequence on the end of the time series. The next time period.



getRangeDescription
public String getRangeDescription()(Code)
Returns the range description. The range description (possibly null).
See Also:   TimeSeries.setRangeDescription(String)



getTimePeriod
public RegularTimePeriod getTimePeriod(int index)(Code)
Returns the time period at the specified index.
Parameters:
  index - the index of the data item. The time period.



getTimePeriodClass
public Class getTimePeriodClass()(Code)
Returns the time period class for this series.

Only one time period class can be used within a single series (enforced). If you add a data item with a Year for the time period, then all subsequent data items must also have a Year for the time period. The time period class (never null).




getTimePeriods
public Collection getTimePeriods()(Code)
Returns a collection of all the time periods in the time series. A collection of all the time periods.



getTimePeriodsUniqueToOtherSeries
public Collection getTimePeriodsUniqueToOtherSeries(TimeSeries series)(Code)
Returns a collection of time periods in the specified series, but not in this series, and therefore unique to the specified series.
Parameters:
  series - the series to check against this one. The unique time periods.



getValue
public Number getValue(int index)(Code)
Returns the value at the specified index.
Parameters:
  index - index of a value. The value (possibly null).



getValue
public Number getValue(RegularTimePeriod period)(Code)
Returns the value for a time period. If there is no data item with the specified period, this method will return null.
Parameters:
  period - time period (null not permitted). The value (possibly null).



hashCode
public int hashCode()(Code)
Returns a hash code value for the object. The hashcode



removeAgedItems
public void removeAgedItems(boolean notify)(Code)
Age items in the series. Ensure that the timespan from the youngest to the oldest record in the series does not exceed maximumItemAge time periods. Oldest items will be removed if required.
Parameters:
  notify - controls whether or not a SeriesChangeEvent is sent to registered listeners IF any items are removed.



removeAgedItems
public void removeAgedItems(long latest, boolean notify)(Code)
Age items in the series. Ensure that the timespan from the supplied time to the oldest record in the series does not exceed history count. oldest items will be removed if required.
Parameters:
  latest - the time to be compared against when aging data (specified in milliseconds).
Parameters:
  notify - controls whether or not a SeriesChangeEvent is sent to registered listeners IF any items are removed.



setDomainDescription
public void setDomainDescription(String description)(Code)
Sets the domain description and sends a PropertyChangeEvent (with the property name Domain) to all registered property change listeners.
Parameters:
  description - the description (null permitted).
See Also:   TimeSeries.getDomainDescription()



setMaximumItemAge
public void setMaximumItemAge(long periods)(Code)
Sets the number of time units in the 'history' for the series. This provides one mechanism for automatically dropping old data from the time series. For example, if a series contains daily data, you might set the history count to 30. Then, when you add a new data item, all data items more than 30 days older than the latest value are automatically dropped from the series.
Parameters:
  periods - the number of time periods.
See Also:   TimeSeries.getMaximumItemAge()



setMaximumItemCount
public void setMaximumItemCount(int maximum)(Code)
Sets the maximum number of items that will be retained in the series. If you add a new item to the series such that the number of items will exceed the maximum item count, then the FIRST element in the series is automatically removed, ensuring that the maximum item count is not exceeded.
Parameters:
  maximum - the maximum (requires >= 0).
See Also:   TimeSeries.getMaximumItemCount()



setRangeDescription
public void setRangeDescription(String description)(Code)
Sets the range description and sends a PropertyChangeEvent (with the property name Range) to all registered listeners.
Parameters:
  description - the description (null permitted).
See Also:   TimeSeries.getRangeDescription()



update
public void update(RegularTimePeriod period, Number value)(Code)
Updates (changes) the value for a time period. Throws a SeriesException if the period does not exist.
Parameters:
  period - the period (null not permitted).
Parameters:
  value - the value (null permitted).



update
public void update(int index, Number value)(Code)
Updates (changes) the value of a data item.
Parameters:
  index - the index of the data item.
Parameters:
  value - the new value (null permitted).



Methods inherited from org.jfree.data.general.Series
public void addChangeListener(SeriesChangeListener listener)(Code)(Java Doc)
public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void firePropertyChange(String property, Object oldValue, Object newValue)(Code)(Java Doc)
public void fireSeriesChanged()(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public Comparable getKey()(Code)(Java Doc)
public boolean getNotify()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
protected void notifyListeners(SeriesChangeEvent event)(Code)(Java Doc)
public void removeChangeListener(SeriesChangeListener listener)(Code)(Java Doc)
public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public void setDescription(String description)(Code)(Java Doc)
public void setKey(Comparable key)(Code)(Java Doc)
public void setNotify(boolean notify)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.