Class StandardEntityCollection

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List entities
      Storage for the entities.
      private static long serialVersionUID
      For serialization.
    • Constructor Summary

      Constructors 
      Constructor Description
      StandardEntityCollection()
      Constructs a new entity collection (initially empty).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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.
      java.lang.Object clone()
      Returns a clone of this entity collection.
      boolean equals​(java.lang.Object obj)
      Tests this object for equality with an arbitrary object.
      java.util.Collection getEntities()
      Returns the entities in an unmodifiable collection.
      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.
      ChartEntity getEntity​(int index)
      Returns a chart entity from the collection.
      int getEntityCount()
      Returns the number of entities in the collection.
      java.util.Iterator iterator()
      Returns an iterator for the entities in the collection.
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For serialization.
        See Also:
        Constant Field Values
      • entities

        private java.util.List entities
        Storage for the entities.
    • Constructor Detail

      • StandardEntityCollection

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

      • getEntityCount

        public int getEntityCount()
        Returns the number of entities in the collection.
        Specified by:
        getEntityCount in interface EntityCollection
        Returns:
        The entity count.
      • clear

        public void clear()
        Clears all the entities from the collection.
        Specified by:
        clear in interface EntityCollection
      • add

        public void add​(ChartEntity entity)
        Adds an entity to the collection.
        Specified by:
        add in interface EntityCollection
        Parameters:
        entity - the entity (null not permitted).
      • addAll

        public void addAll​(EntityCollection collection)
        Adds all the entities from the specified collection.
        Specified by:
        addAll in interface EntityCollection
        Parameters:
        collection - the collection of entities (null not permitted).
      • 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.
        Specified by:
        getEntity in interface EntityCollection
        Parameters:
        x - the x coordinate.
        y - the y coordinate.
        Returns:
        The entity (possibly null).
      • getEntities

        public java.util.Collection getEntities()
        Returns the entities in an unmodifiable collection.
        Specified by:
        getEntities in interface EntityCollection
        Returns:
        The entities.
      • iterator

        public java.util.Iterator iterator()
        Returns an iterator for the entities in the collection.
        Specified by:
        iterator in interface EntityCollection
        Returns:
        An iterator.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this object for equality with an arbitrary object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to test against (null permitted).
        Returns:
        A boolean.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns a clone of this entity collection.
        Specified by:
        clone in interface PublicCloneable
        Overrides:
        clone in class java.lang.Object
        Returns:
        A clone.
        Throws:
        java.lang.CloneNotSupportedException - if the object cannot be cloned.