1. /* ===========================================================
  2. * JFreeChart : a free chart library for the Java(tm) platform
  3. * ===========================================================
  4. *
  5. * (C) Copyright 2000-2004, by Object Refinery Limited and Contributors.
  6. *
  7. * Project Info: http://www.jfree.org/jfreechart/index.html
  8. *
  9. * This library is free software; you can redistribute it and/or modify it under the terms
  10. * of the GNU Lesser General Public License as published by the Free Software Foundation;
  11. * either version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  14. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License along with this
  18. * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. *
  21. * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
  22. * in the United States and other countries.]
  23. *
  24. * --------------
  25. * XYDataset.java
  26. * --------------
  27. * (C) Copyright 2000-2004, by Object Refinery Limited.
  28. *
  29. * Original Author: David Gilbert (for Object Refinery Limited);
  30. * Contributor(s): -;
  31. *
  32. * $Id: XYDataset.java,v 1.1 2004/08/31 15:36:12 mungady Exp $
  33. *
  34. * Changes (from 18-Sep-2001)
  35. * --------------------------
  36. * 18-Sep-2001 : Added standard header and fixed DOS encoding problem (DG);
  37. * 15-Oct-2001 : Moved to a new package (com.jrefinery.data.*) (DG);
  38. * 22-Oct-2001 : Renamed DataSource.java --> Dataset.java etc. (DG);
  39. * 17-Nov-2001 : Now extends SeriesDataset (DG);
  40. * 15-Jul-2004 : Switched getX() with getXValue() and getY() with getYValue() (DG);
  41. * 29-Jul-2004 : Added getDomainOrder() method (DG);
  42. * 18-Aug-2004 : Moved from org.jfree.data --> org.jfree.data.xy (DG);
  43. *
  44. */
  45. package org.jfree.data.xy;
  46. import org.jfree.data.DomainOrder;
  47. import org.jfree.data.general.SeriesDataset;
  48. /**
  49. * An interface through which data in the form of (x, y) items can be accessed.
  50. */
  51. public interface XYDataset extends SeriesDataset {
  52. /**
  53. * Returns the order of the domain (or X) values returned by the dataset.
  54. *
  55. * @return The order (never <code>null</code>).
  56. */
  57. public DomainOrder getDomainOrder();
  58. /**
  59. * Returns the number of items in a series.
  60. *
  61. * @param series the series index (zero-based).
  62. *
  63. * @return The item count.
  64. */
  65. public int getItemCount(int series);
  66. /**
  67. * Returns the x-value for an item within a series. The x-values may or may not be returned
  68. * in ascending order, that is up to the class implementing the interface.
  69. *
  70. * @param series the series index (zero-based).
  71. * @param item the item index (zero-based).
  72. *
  73. * @return The x-value (never <code>null</code>).
  74. */
  75. public Number getX(int series, int item);
  76. /**
  77. * Returns the x-value (as a double primitive) for an item within a series.
  78. *
  79. * @param series the series index (zero-based).
  80. * @param item the item index (zero-based).
  81. *
  82. * @return The x-value.
  83. */
  84. public double getXValue(int series, int item);
  85. /**
  86. * Returns the y-value for an item within a series.
  87. *
  88. * @param series the series index (zero-based).
  89. * @param item the item index (zero-based).
  90. *
  91. * @return The y-value (possibly <code>null</code>).
  92. */
  93. public Number getY(int series, int item);
  94. /**
  95. * Returns the y-value (as a double primitive) for an item within a series.
  96. *
  97. * @param series the series index (zero-based).
  98. * @param item the item index (zero-based).
  99. *
  100. * @return The y-value.
  101. */
  102. public double getYValue(int series, int item);
  103. }