edu.neu.ccs.quick
Class QuickArrayList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byedu.neu.ccs.quick.QuickArrayList
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable

public class QuickArrayList
extends ArrayList

QuickArrayList extends ArrayList by adding one constructor and three methods addItems, setItems, and removeItems that handle an array of Object at once.

All constructors of the original ArrayList class are provided as well.

No changes are made to the internal data structure or to any inherited methods.

Since:
2.3
Version:
2.3
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
 
Fields inherited from class java.util.ArrayList
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
QuickArrayList()
          A constructor that delegates to class ArrayList.
QuickArrayList(Collection c)
          A constructor that delegates to class ArrayList.
QuickArrayList(int initialCapacity)
          A constructor that delegates to class ArrayList.
QuickArrayList(Object[] items)
          Constructor that adds the given array of items one-by-one to the array list.
 
Method Summary
 void addItems(Object[] items)
          Method that adds the given array of items one-by-one to the array list.
 void removeItems(Object[] items)
          Method that removes the given array of items one-by-one from the array list.
 void setItems(Object[] items)
          Method that first clears this array list of any existing items and then adds the given array of items one-by-one to the array list.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, 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, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

QuickArrayList

public QuickArrayList()
A constructor that delegates to class ArrayList.


QuickArrayList

public QuickArrayList(Collection c)
A constructor that delegates to class ArrayList.


QuickArrayList

public QuickArrayList(int initialCapacity)
A constructor that delegates to class ArrayList.


QuickArrayList

public QuickArrayList(Object[] items)

Constructor that adds the given array of items one-by-one to the array list.

The capacity is set to the length of items.

If items is null, then the capacity is set to 10 (Java default) and nothing is added.

Parameters:
items - the array of items to add to this array list
See Also:
addItems(Object[])
Method Detail

addItems

public void addItems(Object[] items)

Method that adds the given array of items one-by-one to the array list.

If items is null, then does nothing.

Parameters:
items - the array of items to add to this array list
See Also:
QuickArrayList(Object[]), setItems(Object[]), removeItems(Object[])

setItems

public void setItems(Object[] items)

Method that first clears this array list of any existing items and then adds the given array of items one-by-one to the array list.

If items is null, then this method is equivalent to the inherited method clear.

Parameters:
items - the array of items to add to this array list after clearance
See Also:
addItems(Object[]), removeItems(Object[])

removeItems

public void removeItems(Object[] items)

Method that removes the given array of items one-by-one from the array list.

If items is null, then does nothing.

Parameters:
items - the array of items to remove from this array list
See Also:
addItems(Object[]), setItems(Object[])