1. /* ===========================================================
  2. * JFreeChart : a free chart library for the Java(tm) platform
  3. * ===========================================================
  4. *
  5. * (C) Copyright 2000-2005, 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. * Dataset.java
  26. * ------------
  27. * (C) Copyright 2000-2005, by Object Refinery Limited.
  28. *
  29. * Original Author: David Gilbert (for Object Refinery Limited);
  30. * Contributor(s): -;
  31. *
  32. * $Id: Dataset.java,v 1.2 2005/01/11 15:24:07 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 : Changed name to Dataset.java (DG);
  39. * 17-Nov-2001 : Added getLegendItemCount() and getLegendItemLabels() methods, created
  40. * SeriesDataset interface and transferred series related methods out (DG);
  41. * 22-Jan-2002 : Reconsidered (and removed) the getLegendItemCount() and getLegendItemLabels()
  42. * methods...leave this to client code (DG);
  43. * 27-Sep-2002 : Added get/setDatasetGroup() methods (DG);
  44. * 10-Jan-2003 : Updated Javadocs (DG);
  45. *
  46. */
  47. package org.jfree.data.general;
  48. /**
  49. * The base interface for data sets.
  50. * <P>
  51. * All datasets are required to support the {@link DatasetChangeEvent} mechanism by allowing
  52. * listeners to register and receive notification of any changes to the dataset.
  53. * <P>
  54. * In addition, all datasets must belong to one (and only one) {@link DatasetGroup}. The group
  55. * object maintains a reader-writer lock which provides synchronised access to the datasets in
  56. * multi-threaded code.
  57. *
  58. *
  59. */
  60. public interface Dataset {
  61. /**
  62. * Registers an object for notification of changes to the dataset.
  63. *
  64. * @param listener the object to register.
  65. */
  66. public void addChangeListener(DatasetChangeListener listener);
  67. /**
  68. * Deregisters an object for notification of changes to the dataset.
  69. *
  70. * @param listener the object to deregister.
  71. */
  72. public void removeChangeListener(DatasetChangeListener listener);
  73. /**
  74. * Returns the dataset group.
  75. *
  76. * @return The dataset group.
  77. */
  78. public DatasetGroup getGroup();
  79. /**
  80. * Sets the dataset group.
  81. *
  82. * @param group the dataset group.
  83. */
  84. public void setGroup(DatasetGroup group);
  85. }