Frames | No Frames |
1: /* =========================================================== 2: * JFreeChart : a free chart library for the Java(tm) platform 3: * =========================================================== 4: * 5: * (C) Copyright 2000-2007, 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 10: * under the terms of the GNU Lesser General Public License as published by 11: * the Free Software Foundation; either version 2.1 of the License, or 12: * (at your option) any later version. 13: * 14: * This library is distributed in the hope that it will be useful, but 15: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17: * License for more details. 18: * 19: * You should have received a copy of the GNU Lesser General Public 20: * License along with this library; if not, write to the Free Software 21: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 22: * USA. 23: * 24: * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 25: * in the United States and other countries.] 26: * 27: * ------------ 28: * Dataset.java 29: * ------------ 30: * (C) Copyright 2000-2007, by Object Refinery Limited. 31: * 32: * Original Author: David Gilbert (for Object Refinery Limited); 33: * Contributor(s): -; 34: * 35: * Changes (from 18-Sep-2001) 36: * -------------------------- 37: * 18-Sep-2001 : Added standard header and fixed DOS encoding problem (DG); 38: * 15-Oct-2001 : Moved to a new package (com.jrefinery.data.*) (DG); 39: * 22-Oct-2001 : Changed name to Dataset.java (DG); 40: * 17-Nov-2001 : Added getLegendItemCount() and getLegendItemLabels() methods, 41: * created SeriesDataset interface and transferred series related 42: * methods out (DG); 43: * 22-Jan-2002 : Reconsidered (and removed) the getLegendItemCount() and 44: * getLegendItemLabels() methods...leave this to client code (DG); 45: * 27-Sep-2002 : Added get/setDatasetGroup() methods (DG); 46: * 10-Jan-2003 : Updated Javadocs (DG); 47: * 48: */ 49: 50: package org.jfree.data.general; 51: 52: /** 53: * The base interface for data sets. 54: * <P> 55: * All datasets are required to support the {@link DatasetChangeEvent} 56: * mechanism by allowing listeners to register and receive notification of any 57: * changes to the dataset. 58: * <P> 59: * In addition, all datasets must belong to one (and only one) 60: * {@link DatasetGroup}. The group object maintains a reader-writer lock 61: * which provides synchronised access to the datasets in multi-threaded code. 62: */ 63: public interface Dataset { 64: 65: /** 66: * Registers an object for notification of changes to the dataset. 67: * 68: * @param listener the object to register. 69: */ 70: public void addChangeListener(DatasetChangeListener listener); 71: 72: /** 73: * Deregisters an object for notification of changes to the dataset. 74: * 75: * @param listener the object to deregister. 76: */ 77: public void removeChangeListener(DatasetChangeListener listener); 78: 79: /** 80: * Returns the dataset group. 81: * 82: * @return The dataset group. 83: */ 84: public DatasetGroup getGroup(); 85: 86: /** 87: * Sets the dataset group. 88: * 89: * @param group the dataset group. 90: */ 91: public void setGroup(DatasetGroup group); 92: 93: }