org.jfree.chart.entity

Class StandardEntityCollection

public class StandardEntityCollection extends Object implements EntityCollection, Cloneable, PublicCloneable, Serializable

A standard implementation of the EntityCollection interface.
Constructor Summary
StandardEntityCollection()
Constructs a new entity collection (initially empty).
Method Summary
voidadd(ChartEntity entity)
Adds an entity to the collection.
voidaddAll(EntityCollection collection)
Adds all the entities from the specified collection.
voidclear()
Clears all the entities from the collection.
Objectclone()
Returns a clone of this entity collection.
booleanequals(Object obj)
Tests this object for equality with an arbitrary object.
CollectiongetEntities()
Returns the entities in an unmodifiable collection.
ChartEntitygetEntity(int index)
Returns a chart entity from the collection.
ChartEntitygetEntity(double x, double y)
Returns the last entity in the list with an area that encloses the specified coordinates, or null if there is no such entity.
intgetEntityCount()
Returns the number of entities in the collection.
Iteratoriterator()
Returns an iterator for the entities in the collection.

Constructor Detail

StandardEntityCollection

public StandardEntityCollection()
Constructs a new entity collection (initially empty).

Method Detail

add

public void add(ChartEntity entity)
Adds an entity to the collection.

Parameters: entity the entity (null not permitted).

addAll

public void addAll(EntityCollection collection)
Adds all the entities from the specified collection.

Parameters: collection the collection of entities (null not permitted).

clear

public void clear()
Clears all the entities from the collection.

clone

public Object clone()
Returns a clone of this entity collection.

Returns: A clone.

Throws: CloneNotSupportedException if the object cannot be cloned.

equals

public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.

Parameters: obj the object to test against (null permitted).

Returns: A boolean.

getEntities

public Collection getEntities()
Returns the entities in an unmodifiable collection.

Returns: The entities.

getEntity

public ChartEntity getEntity(int index)
Returns a chart entity from the collection.

Parameters: index the entity index.

Returns: The entity.

See Also: add

getEntity

public ChartEntity getEntity(double x, double y)
Returns the last entity in the list with an area that encloses the specified coordinates, or null if there is no such entity.

Parameters: x the x coordinate. y the y coordinate.

Returns: The entity (possibly null).

getEntityCount

public int getEntityCount()
Returns the number of entities in the collection.

Returns: The entity count.

iterator

public Iterator iterator()
Returns an iterator for the entities in the collection.

Returns: An iterator.