Summ:  Nested Constr. Methods    Details:  Constr. Methods      Class:  Serial Prev Next
com.artfulbits.aiCharts.Base
Class ChartCollection<E>

java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<E> com.artfulbits.aiCharts.Base.ChartCollection<E>

Declaration: public class ChartCollection<E> extends java.util.ArrayList<E>
Type Parameters: E - type of items that collection will contain.
All Interfaces: java.lang.Cloneable, java.util.Collection<E>, java.lang.Iterable<E>, java.util.List<E>, java.util.RandomAccess, java.io.Serializable
Direct Subclasses: ChartNamedCollection<E>

 

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

 

Since: 1.0
See also: ChartNamedCollectionSerialization

 

 

Nested Members Summary
static interface ChartCollection.IChangeListener<E>
    
Represents IChangeListener class.

 

 

Constructors Summary
ChartCollection(ChartCollection.IChangeListener<E> collectionListener)
    
Initializes a new instance of ChartCollection along with instance of ChartCollection.IChangeListener listening class.

 

 

Methods Summary
boolean add(E object)
    
Adds E to the collection.
void add(int location, E object)
    
Adds E to the collection at specified location.
boolean addAll(int location, java.util.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(java.lang.Object object)
    
Removes specified element from collection.
boolean removeAll(java.util.Collection<?> collection)
    
Removes all objects that exist in passed collection.
E set(int location, E object)
    
Replaces object at desired location with specified one.

 

Methods inherited from class: java.util.ArrayList
addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, size, toArray, toArray, trimToSize

 

Methods inherited from class: java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList

 

Methods inherited from class: java.util.AbstractCollection
containsAll, retainAll, toString

 

Methods inherited from class: java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

 

 

 

ChartCollection

 

public ChartCollection( ChartCollection.IChangeListener<EcollectionListener)

 

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

 

Parameters:
collectionListener-
instance of generic collectionListener.

 

Since: 1.0

 

 

 

 

add

 

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.

 

Overrides: java.util.ArrayList.add(E)
Implements: java.util.List.add(E), java.util.Collection.add(E)
Since: 1.0

 

 

 

add

 

public void add( int location,
E object)

 

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.

 

Overrides: java.util.ArrayList.add(int,E)
Implements: java.util.List.add(int,E)
Since: 1.0

 

 

 

addAll

 

public boolean addAll( int location,
java.util.Collection<? extends Ecollection)

 

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.

 

Overrides: java.util.ArrayList.addAll(int,Collection)
Implements: java.util.List.addAll(int,Collection)
Since: 1.0

 

 

 

clear

 

public void clear( )

 

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

 

Overrides: java.util.ArrayList.clear()
Implements: java.util.List.clear(), java.util.Collection.clear()
Since: 1.0

 

 

 

remove

 

public E remove( int location)

 

Removes element from collection at specified location.

 

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

 

Overrides: java.util.ArrayList.remove(int)
Implements: java.util.List.remove(int)
Since: 1.0

 

 

 

remove

 

public boolean remove( java.lang.Object object)

 

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

 

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

 

Overrides: java.util.ArrayList.remove(Object)
Implements: java.util.List.remove(Object), java.util.Collection.remove(Object)
Since: 1.0

 

 

 

removeAll

 

public boolean removeAll( java.util.Collection<?> collection)

 

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

 

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

 

Overrides: java.util.AbstractCollection.removeAll(Collection)
Implements: java.util.List.removeAll(Collection), java.util.Collection.removeAll(Collection)
Since: 1.0

 

 

 

set

 

public E set( int location,
E object)

 

Replaces object at desired location with specified one. Raises onChanged(E,E,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.

 

Overrides: java.util.ArrayList.set(int,E)
Implements: java.util.List.set(int,E)
Since: 1.0

 

 

© 2005 - 2010 ArtfulBits. All rights reserved.