1 /* ====================================== 2 * JFreeChart : a free Java chart library 3 * ====================================== 4 * 5 * Project Info: http://www.jfree.org/jfreechart/index.html 6 * Project Lead: David Gilbert (david.gilbert@object-refinery.com); 7 * 8 * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors. 9 * 10 * This library is free software; you can redistribute it and/or modify it under the terms 11 * of the GNU Lesser General Public License as published by the Free Software Foundation; 12 * either version 2.1 of the License, or (at your option) any later version. 13 * 14 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 * See the GNU Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License along with this 19 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 * Boston, MA 02111-1307, USA. 21 * 22 * ------------ 23 * Dataset.java 24 * ------------ 25 * (C) Copyright 2000-2003, by Object Refinery Limited. 26 * 27 * Original Author: David Gilbert (for Object Refinery Limited); 28 * Contributor(s): -; 29 * 30 * $Id: Dataset.java,v 1.3 2003/06/13 15:46:39 mungady Exp $ 31 * 32 * Changes (from 18-Sep-2001) 33 * -------------------------- 34 * 18-Sep-2001 : Added standard header and fixed DOS encoding problem (DG); 35 * 15-Oct-2001 : Moved to a new package (com.jrefinery.data.*) (DG); 36 * 22-Oct-2001 : Changed name to Dataset.java (DG); 37 * 17-Nov-2001 : Added getLegendItemCount() and getLegendItemLabels() methods, created 38 * SeriesDataset interface and transferred series related methods out (DG); 39 * 22-Jan-2002 : Reconsidered (and removed) the getLegendItemCount() and getLegendItemLabels() 40 * methods...leave this to client code (DG); 41 * 27-Sep-2002 : Added get/setDatasetGroup(...) methods (DG); 42 * 10-Jan-2003 : Updated Javadocs (DG); 43 * 44 */ 45 46 package org.jfree.data; 47 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 * @author David Gilbert 59 * 60 */ 61 public interface Dataset { 62 63 /** 64 * Registers an object for notification of changes to the dataset. 65 * 66 * @param listener the object to register. 67 */ 68 public void addChangeListener(DatasetChangeListener listener); 69 70 /** 71 * Deregisters an object for notification of changes to the dataset. 72 * 73 * @param listener the object to deregister. 74 */ 75 public void removeChangeListener(DatasetChangeListener listener); 76 77 /** 78 * Returns the dataset group. 79 * 80 * @return the dataset group. 81 */ 82 public DatasetGroup getGroup(); 83 84 /** 85 * Sets the dataset group. 86 * 87 * @param group the dataset group. 88 */ 89 public void setGroup(DatasetGroup group); 90 91 } 92