001 /* =========================================================== 002 * JFreeChart : a free chart library for the Java(tm) platform 003 * =========================================================== 004 * 005 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors. 006 * 007 * Project Info: http://www.jfree.org/jfreechart/index.html 008 * 009 * This library is free software; you can redistribute it and/or modify it 010 * under the terms of the GNU Lesser General Public License as published by 011 * the Free Software Foundation; either version 2.1 of the License, or 012 * (at your option) any later version. 013 * 014 * This library is distributed in the hope that it will be useful, but 015 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 016 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 017 * License for more details. 018 * 019 * You should have received a copy of the GNU Lesser General Public 020 * License along with this library; if not, write to the Free Software 021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 022 * USA. 023 * 024 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 025 * in the United States and other countries.] 026 * 027 * -------------- 028 * XYDataset.java 029 * -------------- 030 * (C) Copyright 2000-2004, by Object Refinery Limited. 031 * 032 * Original Author: David Gilbert (for Object Refinery Limited); 033 * Contributor(s): -; 034 * 035 * $Id: XYDataset.java,v 1.2.2.1 2005/10/25 21:36:51 mungady Exp $ 036 * 037 * Changes (from 18-Sep-2001) 038 * -------------------------- 039 * 18-Sep-2001 : Added standard header and fixed DOS encoding problem (DG); 040 * 15-Oct-2001 : Moved to a new package (com.jrefinery.data.*) (DG); 041 * 22-Oct-2001 : Renamed DataSource.java --> Dataset.java etc. (DG); 042 * 17-Nov-2001 : Now extends SeriesDataset (DG); 043 * 15-Jul-2004 : Switched getX() with getXValue() and getY() with 044 * getYValue() (DG); 045 * 29-Jul-2004 : Added getDomainOrder() method (DG); 046 * 18-Aug-2004 : Moved from org.jfree.data --> org.jfree.data.xy (DG); 047 * 048 */ 049 050 package org.jfree.data.xy; 051 052 import org.jfree.data.DomainOrder; 053 import org.jfree.data.general.SeriesDataset; 054 055 /** 056 * An interface through which data in the form of (x, y) items can be accessed. 057 */ 058 public interface XYDataset extends SeriesDataset { 059 060 /** 061 * Returns the order of the domain (or X) values returned by the dataset. 062 * 063 * @return The order (never <code>null</code>). 064 */ 065 public DomainOrder getDomainOrder(); 066 067 /** 068 * Returns the number of items in a series. 069 * 070 * @param series the series index (zero-based). 071 * 072 * @return The item count. 073 */ 074 public int getItemCount(int series); 075 076 /** 077 * Returns the x-value for an item within a series. The x-values may or 078 * may not be returned in ascending order, that is up to the class 079 * implementing the interface. 080 * 081 * @param series the series index (zero-based). 082 * @param item the item index (zero-based). 083 * 084 * @return The x-value (never <code>null</code>). 085 */ 086 public Number getX(int series, int item); 087 088 /** 089 * Returns the x-value (as a double primitive) for an item within a series. 090 * 091 * @param series the series index (zero-based). 092 * @param item the item index (zero-based). 093 * 094 * @return The x-value. 095 */ 096 public double getXValue(int series, int item); 097 098 /** 099 * Returns the y-value for an item within a series. 100 * 101 * @param series the series index (zero-based). 102 * @param item the item index (zero-based). 103 * 104 * @return The y-value (possibly <code>null</code>). 105 */ 106 public Number getY(int series, int item); 107 108 /** 109 * Returns the y-value (as a double primitive) for an item within a series. 110 * 111 * @param series the series index (zero-based). 112 * @param item the item index (zero-based). 113 * 114 * @return The y-value. 115 */ 116 public double getYValue(int series, int item); 117 118 }