KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > chart > entity > EntityCollection


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  * EntityCollection.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: EntityCollection.java,v 1.5 2005/03/18 12:34:35 mungady Exp $
35  *
36  * Changes
37  * -------
38  * 23-May-2002 : Version 1 (DG);
39  * 25-Jun-2002 : Removed unnecessary import (DG);
40  * 26-Jun-2002 : Added iterator() method (DG);
41  * 03-Oct-2002 : Fixed errors reported by Checkstyle (DG);
42  * 30-Jan-2004 : Added a method to add a collection of entities.
43  * 11-Jan-2005 : Removed deprecated code in preparation for the 1.0.0
44  * release (DG);
45  * 18-Jan-2005 : Added getEntity() and getEntityCount() methods (DG);
46  *
47  */

48
49 package org.jfree.chart.entity;
50
51 import java.util.Collection JavaDoc;
52 import java.util.Iterator JavaDoc;
53
54 /**
55  * This interface defines the methods used to access an ordered list of
56  * {@link ChartEntity} objects.
57  */

58 public interface EntityCollection {
59
60     /**
61      * Clears all entities.
62      */

63     public void clear();
64
65     /**
66      * Adds an entity to the collection.
67      *
68      * @param entity the entity (<code>null</code> not permitted).
69      */

70     public void add(ChartEntity entity);
71
72     /**
73      * Adds the entities from another collection to this collection.
74      *
75      * @param collection the other collection.
76      */

77     public void addAll(EntityCollection collection);
78     
79     /**
80      * Returns an entity whose area contains the specified point.
81      *
82      * @param x the x coordinate.
83      * @param y the y coordinate.
84      *
85      * @return The entity.
86      */

87     public ChartEntity getEntity(double x, double y);
88
89     /**
90      * Returns an entity from the collection.
91      *
92      * @param index the index (zero-based).
93      *
94      * @return An entity.
95      */

96     public ChartEntity getEntity(int index);
97     
98     /**
99      * Returns the entity count.
100      *
101      * @return The entity count.
102      */

103     public int getEntityCount();
104     
105     /**
106      * Returns the entities in an unmodifiable collection.
107      *
108      * @return The entities.
109      */

110     public Collection JavaDoc getEntities();
111     
112     /**
113      * Returns an iterator for the entities in the collection.
114      *
115      * @return An iterator.
116      */

117     public Iterator JavaDoc iterator();
118
119 }
120
Popular Tags