Package org.jfree.chart.entity
Class StandardEntityCollection
java.lang.Object
org.jfree.chart.entity.StandardEntityCollection
- All Implemented Interfaces:
Serializable
,Cloneable
,EntityCollection
,PublicCloneable
public class StandardEntityCollection
extends Object
implements EntityCollection, Cloneable, PublicCloneable, Serializable
A standard implementation of the
EntityCollection
interface.- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a new entity collection (initially empty). -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ChartEntity entity) Adds an entity to the collection.void
addAll
(EntityCollection collection) Adds all the entities from the specified collection.void
clear()
Clears all the entities from the collection.clone()
Returns a clone of this entity collection.boolean
Tests this object for equality with an arbitrary object.Returns the entities in an unmodifiable collection.getEntity
(double x, double y) Returns the last entity in the list with an area that encloses the specified coordinates, ornull
if there is no such entity.getEntity
(int index) Returns a chart entity from the collection.int
Returns the number of entities in the collection.iterator()
Returns an iterator for the entities in the collection.
-
Constructor Details
-
StandardEntityCollection
public StandardEntityCollection()Constructs a new entity collection (initially empty).
-
-
Method Details
-
getEntityCount
Returns the number of entities in the collection.- Specified by:
getEntityCount
in interfaceEntityCollection
- Returns:
- The entity count.
-
getEntity
Returns a chart entity from the collection.- Specified by:
getEntity
in interfaceEntityCollection
- Parameters:
index
- the entity index.- Returns:
- The entity.
- See Also:
-
clear
Clears all the entities from the collection.- Specified by:
clear
in interfaceEntityCollection
-
add
Adds an entity to the collection.- Specified by:
add
in interfaceEntityCollection
- Parameters:
entity
- the entity (null
not permitted).
-
addAll
Adds all the entities from the specified collection.- Specified by:
addAll
in interfaceEntityCollection
- Parameters:
collection
- the collection of entities (null
not permitted).
-
getEntity
Returns the last entity in the list with an area that encloses the specified coordinates, ornull
if there is no such entity.- Specified by:
getEntity
in interfaceEntityCollection
- Parameters:
x
- the x coordinate.y
- the y coordinate.- Returns:
- The entity (possibly
null
).
-
getEntities
Returns the entities in an unmodifiable collection.- Specified by:
getEntities
in interfaceEntityCollection
- Returns:
- The entities.
-
iterator
Returns an iterator for the entities in the collection.- Specified by:
iterator
in interfaceEntityCollection
- Returns:
- An iterator.
-
equals
Tests this object for equality with an arbitrary object. -
clone
Returns a clone of this entity collection.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if the object cannot be cloned.
-