public class

ChartCollection

extends ArrayList<E>
java.lang.Object
   ↳ java.util.AbstractCollection<E>
     ↳ java.util.AbstractList<E>
       ↳ java.util.ArrayList<E>
         ↳ com.artfulbits.aiCharts.Base.ChartCollection<E>
Known Direct Subclasses

Class Overview

Represents generic specialized collection for chart elements. Collection supports changes notification supplied by ChartCollection.IChangeListener class instance from constructor.

Summary

Nested Classes
interface ChartCollection.IChangeListener<E> Represents IChangeListener class. 
Public Constructors
ChartCollection(IChangeListener<E> collectionListener)
Initializes a new instance of ChartCollection along with instance of ChartCollection.IChangeListener listening class.
Public Methods
void add(int location, E object)
Adds E to the collection at specified location.
final boolean add(E object)
Adds E to the collection.
boolean addAll(int location, Collection<? extends E> collection)
Adds all E typed elements to the collection.
void clear()
Removes all objects from collection.
E remove(int location)
Removes element from collection at specified location.
boolean remove(Object object)
Removes specified element from collection.
boolean removeAll(Collection<?> collection)
Removes all objects that exist in passed collection.
E set(int location, E object)
Replaces object at desired location with specified one.
[Expand]
Inherited Methods
From class java.util.ArrayList
From class java.util.AbstractList
From class java.util.AbstractCollection
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.List

Public Constructors

public ChartCollection (IChangeListener<E> collectionListener)

Initializes a new instance of ChartCollection along with instance of ChartCollection.IChangeListener listening class.

Parameters
collectionListener instance of generic collectionListener.

Public Methods

public void add (int location, E object)

Since: API Level

Adds E to the collection at specified location.

Parameters
location desired zero-based location in collection.
object type of E that is indented to be added to collection.

public final boolean add (E object)

Adds E to the collection.

Parameters
object object type of E that is indented to be added to collection.
Returns
  • true if object was successfully added to collection, otherwise false.

public boolean addAll (int location, Collection<? extends E> collection)

Since: API Level

Adds all E typed elements to the collection.

Parameters
location desired zero-based starting location in collection.
collection E elements that is indented to be added to this collection.
Returns
  • true if objects were successfully added to collection, otherwise false.

public void clear ()

Since: API Level

Removes all objects from collection. Raises #onChanged(Object, Object, int) for each object removed.

public E remove (int location)

Since: API Level

Removes element from collection at specified location.

Parameters
location zero-based location of element to remove.
Returns
  • instance of removed object.

public boolean remove (Object object)

Since: API Level

Removes specified element from collection. If removing succeeded, raises #onChanged(Object, Object, int) for removed object.

Parameters
object instance of an object to be removed.
Returns
  • true on successful removal, otherwise false.

public boolean removeAll (Collection<?> collection)

Since: API Level

Removes all objects that exist in passed collection. Raises #onChanged(Object, Object, int) for every object removed.

Parameters
collection target collection of objects to remove.
Returns
  • true on successful removal, otherwise false.

public E set (int location, E object)

Since: API Level

Replaces object at desired location with specified one. Raises #onChanged(Object, Object, int) for the old and new objects.

Parameters
location index of object in the collection that should be replaced.
object new object to replace.
Returns
  • instance of object that was replaced.