KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > data > KeyedValues2D


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
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 License
20  * along with this library; if not, write to the Free Software Foundation,
21  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
24  * in the United States and other countries.]
25  *
26  * ------------------
27  * KeyedValues2D.java
28  * ------------------
29  * (C) Copyright 2002-2005, by Object Refinery Limited.
30  *
31  * Original Author: David Gilbert (for Object Refinery Limited);
32  * Contributor(s): -;
33  *
34  * $Id: KeyedValues2D.java,v 1.3 2005/03/28 19:40:26 mungady Exp $
35  *
36  * Changes
37  * -------
38  * 28-Oct-2002 : Version 1 (DG);
39  * 12-Jan-2005 : Updated Javadocs (DG);
40  *
41  */

42
43 package org.jfree.data;
44
45 import java.util.List JavaDoc;
46
47 /**
48  * An extension of the {@link Values2D} interface where a unique key is
49  * associated with the row and column indices.
50  */

51 public interface KeyedValues2D extends Values2D {
52
53     /**
54      * Returns the row key for a given index.
55      *
56      * @param row the row index (zero-based).
57      *
58      * @return The row key.
59      *
60      * @throws IndexOutOfBoundsException if <code>row</code> is out of bounds.
61      */

62     public Comparable JavaDoc getRowKey(int row);
63
64     /**
65      * Returns the row index for a given key.
66      *
67      * @param key the row key.
68      *
69      * @return The row index, or <code>-1</code> if the key is unrecognised.
70      */

71     public int getRowIndex(Comparable JavaDoc key);
72
73     /**
74      * Returns the row keys.
75      *
76      * @return The keys.
77      */

78     public List JavaDoc getRowKeys();
79
80     /**
81      * Returns the column key for a given index.
82      *
83      * @param column the column index (zero-based).
84      *
85      * @return The column key.
86      *
87      * @throws IndexOutOfBoundsException if <code>row</code> is out of bounds.
88      */

89     public Comparable JavaDoc getColumnKey(int column);
90
91     /**
92      * Returns the column index for a given key.
93      *
94      * @param key the column key.
95      *
96      * @return The column index, or <code>-1</code> if the key is unrecognised.
97      */

98     public int getColumnIndex(Comparable JavaDoc key);
99
100     /**
101      * Returns the column keys.
102      *
103      * @return The keys.
104      */

105     public List JavaDoc getColumnKeys();
106
107     /**
108      * Returns the value associated with the specified keys. This method
109      * should return <code>null</code> if either of the keys is not found.
110      *
111      * @param rowKey the row key.
112      * @param columnKey the column key.
113      *
114      * @return The value.
115      *
116      * @throws UnknownKeyException if either key is not recognised.
117      */

118     public Number JavaDoc getValue(Comparable JavaDoc rowKey, Comparable JavaDoc columnKey);
119
120 }
121
Popular Tags