Java Doc for DynamicTimeSeriesCollection.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) 


org.jfree.data.xy.AbstractIntervalXYDataset
   org.jfree.data.time.DynamicTimeSeriesCollection

DynamicTimeSeriesCollection
public class DynamicTimeSeriesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset,DomainInfo,RangeInfo(Code)
A dynamic dataset.

Like FastTimeSeriesCollection, this class is a functional replacement for JFreeChart's TimeSeriesCollection _and_ TimeSeries classes. FastTimeSeriesCollection is appropriate for a fixed time range; for real-time applications this subclass adds the ability to append new data and discard the oldest. In this class, the arrays used in FastTimeSeriesCollection become FIFO's. NOTE:As presented here, all data is assumed >= 0, an assumption which is embodied only in methods associated with interface RangeInfo.


Inner Class :protected class ValueSequence

Field Summary
final public static  intEND
     Useful constant for controlling the x-value returned for a time period.
final public static  intMIDDLE
     Useful constant for controlling the x-value returned for a time period.
final public static  intSTART
     Useful constant for controlling the x-value returned for a time period.
protected  inthistoryCount
     The history count.
protected  RegularTimePeriod[]pointsInTime
     Storage for the x-values.
protected  ValueSequence[]valueHistory
     An array for storing the objects that represent each series.
protected  CalendarworkingCalendar
    

Constructor Summary
public  DynamicTimeSeriesCollection(int nSeries, int nMoments)
     Constructs a dataset with capacity for N series, tied to default timezone.
public  DynamicTimeSeriesCollection(int nSeries, int nMoments, TimeZone zone)
     Constructs an empty dataset, tied to a specific timezone.
public  DynamicTimeSeriesCollection(int nSeries, int nMoments, RegularTimePeriod timeSample)
     Creates a new dataset.
public  DynamicTimeSeriesCollection(int nSeries, int nMoments, RegularTimePeriod timeSample, TimeZone zone)
     Creates a new dataset.

Method Summary
public  voidaddSeries(float[] values, int seriesNumber, Comparable seriesKey)
     Adds a series to the dataset.
public  voidaddValue(int seriesNumber, int index, float value)
     Adds a value to a series.
public synchronized  RegularTimePeriodadvanceTime()
     Adjust the array offset as needed when a new time-period is added: Increments the indices "oldestAt" and "newestAt", mod(array length), zeroes the series values at newestAt, returns the new TimePeriod.
public  voidappendData(float[] newData)
     Appends new data.
public  voidappendData(float[] newData, int insertionIndex, int refresh)
     Appends data at specified index, for loading up with data from file(s).
protected  voidfindDomainLimits()
     Finds the domain limits.
protected  doublefindMaxValue()
     Returns the maximum value.
protected  voidfireSeriesChanged()
     Sends a SeriesChangeEvent to all registered listeners.
public  RangegetDomainBounds(boolean includeInterval)
     Returns the range of the values in this dataset's domain.
Parameters:
  includeInterval - a flag that determines whether or not thex-interval is taken into account.
public  doublegetDomainLowerBound(boolean includeInterval)
     Returns the minimum x-value in the dataset.
Parameters:
  includeInterval - a flag that determines whether or not thex-interval is taken into account.
public  doublegetDomainUpperBound(boolean includeInterval)
     Returns the maximum x-value in the dataset.
Parameters:
  includeInterval - a flag that determines whether or not thex-interval is taken into account.
public  NumbergetEndX(int series, int item)
     Returns the end x-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based).
public  NumbergetEndY(int series, int item)
     Returns the end y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based).
public  intgetItemCount(int series)
     Returns the number of items in a series.

For this implementation, all series have the same number of items.
Parameters:
  series - the series index (zero-based).

public  intgetNewestIndex()
     Returns the index of the newest data item.
public  RegularTimePeriodgetNewestTime()
     Returns the newest time.
public  intgetOldestIndex()
     Returns the index of the oldest data item.
public  RegularTimePeriodgetOldestTime()
     Returns the oldest time.
public  intgetPosition()
     Returns the x position type (START, MIDDLE or END).
public  RangegetRangeBounds(boolean includeInterval)
     Returns the value range.
Parameters:
  includeInterval - a flag that determines whether or not they-interval is taken into account.
public  doublegetRangeLowerBound(boolean includeInterval)
     Returns the minimum range value.
Parameters:
  includeInterval - a flag that determines whether or not they-interval is taken into account.
public  doublegetRangeUpperBound(boolean includeInterval)
     Returns the maximum range value.
Parameters:
  includeInterval - a flag that determines whether or not they-interval is taken into account.
public  intgetSeriesCount()
     Returns the number of series in the collection.
public  ComparablegetSeriesKey(int series)
     Returns the key for a series.
Parameters:
  series - the series index (zero-based).
public  NumbergetStartX(int series, int item)
     Returns the start x-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based).
public  NumbergetStartY(int series, int item)
     Returns the start y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based).
public  NumbergetX(int series, int item)
     Returns the x-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based).
public  NumbergetY(int series, int item)
     Returns the y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based).
public  doublegetYValue(int series, int item)
     Returns the y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based).
public  voidinvalidateRangeInfo()
     Invalidates the range info.
public  intoffsetFromNewest(int delta)
     Returns the actual index to a time offset by "delta" from newestAt.
Parameters:
  delta - the delta.
public  intoffsetFromOldest(int delta)
    
public  voidsetPosition(int position)
     Sets the x position type (START, MIDDLE or END).
public  voidsetSeriesKey(int seriesNumber, Comparable key)
     Sets the name of a series.
public synchronized  longsetTimeBase(RegularTimePeriod start)
     Fill the pointsInTime with times using TimePeriod.next(): Will silently return if the time array was already populated. Also computes the data cached for later use by methods implementing the DomainInfo interface:
Parameters:
  start - the start.
protected  inttranslateGet(int toFetch)
     Re-map an index, for use in retrieving data.
Parameters:
  toFetch - the index.
protected  intwrapOffset(int protoIndex)
     ??
Parameters:
  protoIndex - the index.

Field Detail
END
final public static int END(Code)
Useful constant for controlling the x-value returned for a time period.



MIDDLE
final public static int MIDDLE(Code)
Useful constant for controlling the x-value returned for a time period.



START
final public static int START(Code)
Useful constant for controlling the x-value returned for a time period.



historyCount
protected int historyCount(Code)
The history count.



pointsInTime
protected RegularTimePeriod[] pointsInTime(Code)
Storage for the x-values.



valueHistory
protected ValueSequence[] valueHistory(Code)
An array for storing the objects that represent each series.



workingCalendar
protected Calendar workingCalendar(Code)
A working calendar (to recycle)




Constructor Detail
DynamicTimeSeriesCollection
public DynamicTimeSeriesCollection(int nSeries, int nMoments)(Code)
Constructs a dataset with capacity for N series, tied to default timezone.
Parameters:
  nSeries - the number of series to be accommodated.
Parameters:
  nMoments - the number of TimePeriods to be spanned.



DynamicTimeSeriesCollection
public DynamicTimeSeriesCollection(int nSeries, int nMoments, TimeZone zone)(Code)
Constructs an empty dataset, tied to a specific timezone.
Parameters:
  nSeries - the number of series to be accommodated
Parameters:
  nMoments - the number of TimePeriods to be spanned
Parameters:
  zone - the timezone.



DynamicTimeSeriesCollection
public DynamicTimeSeriesCollection(int nSeries, int nMoments, RegularTimePeriod timeSample)(Code)
Creates a new dataset.
Parameters:
  nSeries - the number of series.
Parameters:
  nMoments - the number of items per series.
Parameters:
  timeSample - a time period sample.



DynamicTimeSeriesCollection
public DynamicTimeSeriesCollection(int nSeries, int nMoments, RegularTimePeriod timeSample, TimeZone zone)(Code)
Creates a new dataset.
Parameters:
  nSeries - the number of series.
Parameters:
  nMoments - the number of items per series.
Parameters:
  timeSample - a time period sample.
Parameters:
  zone - the time zone.




Method Detail
addSeries
public void addSeries(float[] values, int seriesNumber, Comparable seriesKey)(Code)
Adds a series to the dataset. Only the y-values are supplied, the x-values are specified elsewhere.
Parameters:
  values - the y-values.
Parameters:
  seriesNumber - the series index (zero-based).
Parameters:
  seriesKey - the series key.Use this as-is during setup only, or add the synchronized keyword around the copy loop.



addValue
public void addValue(int seriesNumber, int index, float value)(Code)
Adds a value to a series.
Parameters:
  seriesNumber - the series index.
Parameters:
  index - ??.
Parameters:
  value - the value.



advanceTime
public synchronized RegularTimePeriod advanceTime()(Code)
Adjust the array offset as needed when a new time-period is added: Increments the indices "oldestAt" and "newestAt", mod(array length), zeroes the series values at newestAt, returns the new TimePeriod. The new time period.



appendData
public void appendData(float[] newData)(Code)
Appends new data.
Parameters:
  newData - the data.



appendData
public void appendData(float[] newData, int insertionIndex, int refresh)(Code)
Appends data at specified index, for loading up with data from file(s).
Parameters:
  newData - the data
Parameters:
  insertionIndex - the index value at which to put it
Parameters:
  refresh - value of n in "refresh the display on every nth call"(ignored if <= 0 )



findDomainLimits
protected void findDomainLimits()(Code)
Finds the domain limits. Note: this doesn't need to be synchronized because it's called from within another method that already is.



findMaxValue
protected double findMaxValue()(Code)
Returns the maximum value. The maximum value.



fireSeriesChanged
protected void fireSeriesChanged()(Code)
Sends a SeriesChangeEvent to all registered listeners.



getDomainBounds
public Range getDomainBounds(boolean includeInterval)(Code)
Returns the range of the values in this dataset's domain.
Parameters:
  includeInterval - a flag that determines whether or not thex-interval is taken into account. The range.



getDomainLowerBound
public double getDomainLowerBound(boolean includeInterval)(Code)
Returns the minimum x-value in the dataset.
Parameters:
  includeInterval - a flag that determines whether or not thex-interval is taken into account. The minimum value.



getDomainUpperBound
public double getDomainUpperBound(boolean includeInterval)(Code)
Returns the maximum x-value in the dataset.
Parameters:
  includeInterval - a flag that determines whether or not thex-interval is taken into account. The maximum value.



getEndX
public Number getEndX(int series, int item)(Code)
Returns the end x-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based). The value.



getEndY
public Number getEndY(int series, int item)(Code)
Returns the end y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based). The value.



getItemCount
public int getItemCount(int series)(Code)
Returns the number of items in a series.

For this implementation, all series have the same number of items.
Parameters:
  series - the series index (zero-based). The item count.




getNewestIndex
public int getNewestIndex()(Code)
Returns the index of the newest data item. The index.



getNewestTime
public RegularTimePeriod getNewestTime()(Code)
Returns the newest time. The newest time.



getOldestIndex
public int getOldestIndex()(Code)
Returns the index of the oldest data item. The index.



getOldestTime
public RegularTimePeriod getOldestTime()(Code)
Returns the oldest time. The oldest time.



getPosition
public int getPosition()(Code)
Returns the x position type (START, MIDDLE or END). The x position type.



getRangeBounds
public Range getRangeBounds(boolean includeInterval)(Code)
Returns the value range.
Parameters:
  includeInterval - a flag that determines whether or not they-interval is taken into account. The range.



getRangeLowerBound
public double getRangeLowerBound(boolean includeInterval)(Code)
Returns the minimum range value.
Parameters:
  includeInterval - a flag that determines whether or not they-interval is taken into account. The minimum range value.



getRangeUpperBound
public double getRangeUpperBound(boolean includeInterval)(Code)
Returns the maximum range value.
Parameters:
  includeInterval - a flag that determines whether or not they-interval is taken into account. The maximum range value.



getSeriesCount
public int getSeriesCount()(Code)
Returns the number of series in the collection. The series count.



getSeriesKey
public Comparable getSeriesKey(int series)(Code)
Returns the key for a series.
Parameters:
  series - the series index (zero-based). The key.



getStartX
public Number getStartX(int series, int item)(Code)
Returns the start x-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based). The value.



getStartY
public Number getStartY(int series, int item)(Code)
Returns the start y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based). The value.



getX
public Number getX(int series, int item)(Code)
Returns the x-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based). The value.



getY
public Number getY(int series, int item)(Code)
Returns the y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based). The value.



getYValue
public double getYValue(int series, int item)(Code)
Returns the y-value.
Parameters:
  series - the series index (zero-based).
Parameters:
  item - the item index (zero-based). The value.



invalidateRangeInfo
public void invalidateRangeInfo()(Code)
Invalidates the range info.



offsetFromNewest
public int offsetFromNewest(int delta)(Code)
Returns the actual index to a time offset by "delta" from newestAt.
Parameters:
  delta - the delta. The offset.



offsetFromOldest
public int offsetFromOldest(int delta)(Code)
??
Parameters:
  delta - ?? The offset.



setPosition
public void setPosition(int position)(Code)
Sets the x position type (START, MIDDLE or END).
Parameters:
  position - The x position type.



setSeriesKey
public void setSeriesKey(int seriesNumber, Comparable key)(Code)
Sets the name of a series. If planning to add values individually.
Parameters:
  seriesNumber - the series.
Parameters:
  key - the new key.



setTimeBase
public synchronized long setTimeBase(RegularTimePeriod start)(Code)
Fill the pointsInTime with times using TimePeriod.next(): Will silently return if the time array was already populated. Also computes the data cached for later use by methods implementing the DomainInfo interface:
Parameters:
  start - the start. ??.



translateGet
protected int translateGet(int toFetch)(Code)
Re-map an index, for use in retrieving data.
Parameters:
  toFetch - the index. The translated index.



wrapOffset
protected int wrapOffset(int protoIndex)(Code)
??
Parameters:
  protoIndex - the index. The offset.



Methods inherited from org.jfree.data.xy.AbstractIntervalXYDataset
public double getEndXValue(int series, int item)(Code)(Java Doc)
public double getEndYValue(int series, int item)(Code)(Java Doc)
public double getStartXValue(int series, int item)(Code)(Java Doc)
public double getStartYValue(int series, int item)(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.