java.util

Class ArrayList<E>

Implemented Interfaces:
Cloneable, Collection<E>, Iterable<T>, List<E>, RandomAccess, Serializable
Known Direct Subclasses:
ArrayStack, AttributeList, FastArrayList, LazyDynaList, ManagedList, Phrase, RoleList, RoleUnresolvedList, Section, XfaForm.Stack2, XmpArray

public class ArrayList<E>
extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, Serializable

Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list. (This class is roughly equivalent to Vector, except that it is unsynchronized.)

The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, adding n elements requires O(n) time. All of the other operations run in linear time (roughly speaking). The constant factor is low compared to that for the LinkedList implementation.

Each ArrayList instance has a capacity. The capacity is the size of the array used to store the elements in the list. It is always at least as large as the list size. As elements are added to an ArrayList, its capacity grows automatically. The details of the growth policy are not specified beyond the fact that adding an element has constant amortized time cost.

An application can increase the capacity of an ArrayList instance before adding a large number of elements using the ensureCapacity operation. This may reduce the amount of incremental reallocation.

Note that this implementation is not synchronized. If multiple threads access an ArrayList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements, or explicitly resizes the backing array; merely setting the value of an element is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the list. If no such object exists, the list should be "wrapped" using the Collections.synchronizedList method. This is best done at creation time, to prevent accidental unsynchronized access to the list:

	List list = Collections.synchronizedList(new ArrayList(...));
 

The iterators returned by this class's iterator and listIterator methods are fail-fast: if list is structurally modified at any time after the iterator is created, in any way except through the iterator's own remove or add methods, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.

Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs.

This class is a member of the ../../../guide/collections/index.html"> Java Collections Framework.

Since:
1.2
See Also:
Collection, List, LinkedList, Vector, Collections.synchronizedList(List), Serialized Form

Field Summary

Fields inherited from class java.util.AbstractList<E>

modCount

Constructor Summary

ArrayList()
Constructs an empty list with an initial capacity of ten.
ArrayList(E> c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
ArrayList(int initialCapacity)
Constructs an empty list with the specified initial capacity.

Method Summary

T[] toArray(T[] a)
Returns an array containing all of the elements in this list in the correct order; the runtime type of the returned array is that of the specified array.
boolean
add(E o)
Appends the specified element to the end of this list.
void
add(int index, E element)
Inserts the specified element at the specified position in this list.
boolean
addAll(E> c)
Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator.
boolean
addAll(int index, E> c)
Inserts all of the elements in the specified Collection into this list, starting at the specified position.
void
clear()
Removes all of the elements from this list.
Object
clone()
Returns a shallow copy of this ArrayList instance.
boolean
contains(Object elem)
Returns true if this list contains the specified element.
void
ensureCapacity(int minCapacity)
Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
E
get(int index)
Returns the element at the specified position in this list.
int
indexOf(Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method.
boolean
isEmpty()
Tests if this list has no elements.
int
lastIndexOf(Object elem)
Returns the index of the last occurrence of the specified object in this list.
E
remove(int index)
Removes the element at the specified position in this list.
boolean
remove(Object o)
Removes a single instance of the specified element from this list, if it is present (optional operation).
protected void
removeRange(int fromIndex, int toIndex)
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
E
set(int index, E element)
Replaces the element at the specified position in this list with the specified element.
int
size()
Returns the number of elements in this list.
Object[]
toArray()
Returns an array containing all of the elements in this list in the correct order.
void
trimToSize()
Trims the capacity of this ArrayList instance to be the list's current size.

Methods inherited from class java.util.AbstractList<E>

add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList

Methods inherited from class java.util.AbstractCollection<E>

T[] toArray, add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

ArrayList

public ArrayList()
Constructs an empty list with an initial capacity of ten.
Usages and Demos :

View More Examples of ArrayList()
   1:       System.out.println("time for ArrayList = " +
   2:          timeList(new ArrayList()));
   3:    }
   4: }

View Full Code Here
   1:         doTest(new ModVector());
   2:         doTest(new ArrayList());
   3:         ...
   4:         doTest(Collections.synchronizedList(new ArrayList()));
   5:     nLoops = Integer.parseInt(args[0]);
   6:         ...
   7:     syncTS = new Timestamp();
   8:         doTest(Collections.synchronizedList(new ArrayList()));
   9:     syncTS.stop();

View Full Code Here
   1: 
   2:         List l = new ArrayList();
   3:         Set s = new HashSet();
   4:         ...
   5:         try {
   6:             c.choose(new ArrayList());
   7:             Assert.assertTrue(false);
   8:         ...
   9:         c.reset();
  10:         Assert.assertNull(c.choose(new ArrayList()));

View Full Code Here
   1:         NULL = new AdviceInfoContainer(
   2:                 new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList()
   3:         );
   4:     }

View Full Code Here

ArrayList

public ArrayList(E> c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. The ArrayList instance has an initial capacity of 110% the size of the specified collection.
Parameters:
c - the collection whose elements are to be placed into this list.
Throws:
NullPointerException - if the specified collection is null.
Usages and Demos :

View More Examples of ArrayList(E> c)
   1:     {
   2:         return new ArrayList(((InstallOptionsGuide)guide).getParts());
   3:     }
   4: 
   5:     public Command getCreateGuideCommand(int position)

View Full Code Here
   1:         } else if (source.getClass().isArray()) {
   2:             ArrayList list = new ArrayList(((Object[]) source).length);
   3:             Object[] objects = (Object[]) source;
   4:             int len = objects.length;

View Full Code Here
   1:             {
   2:                 return new ArrayList(((LinkedHashMap)((TableViewer)getViewer()).getInput()).entrySet());
   3:             }
   4: 
   5:             protected void updateStructuredViewerInput(Object input, List elements, List move, boolean isDown)

View Full Code Here
   1: 
   2:         List <Instance> instancesIF = new ArrayList( ((ChoreographyExtension) targetChoreography).getInstances() );
   3:         List <Instance> instancesTHEN = new ArrayList();
   4:         instancesTHEN.addAll(incomingInstances);
   5:         

View Full Code Here
   1: 
   2:         ArrayList commonSRSList = new ArrayList(((MapLayer) mapLayers.get(0)).getFullSRSList());
   3: 
   4:         ...
   5:                 public List getSelectedItems() {
   6:                     List selectedItems = new ArrayList(super.getSelectedItems());
   7: 
   8:         ...
   9:                 public List getItems() {
  10:                     ArrayList items = new ArrayList(items((MapLayerTreeModel.LayerNode) treeModel.getRoot()));

View Full Code Here

ArrayList

public ArrayList(int initialCapacity)
Constructs an empty list with the specified initial capacity.
Parameters:
initialCapacity - the initial capacity of the list.
Throws:
IllegalArgumentException - if the specified initial capacity is negative
Usages and Demos :

View More Examples of ArrayList(int initialCapacity)
   1:     {
   2:         return new ArrayList(((InstallOptionsGuide)guide).getParts());
   3:     }
   4: 
   5:     public Command getCreateGuideCommand(int position)

View Full Code Here
   1:         } else if (source.getClass().isArray()) {
   2:             ArrayList list = new ArrayList(((Object[]) source).length);
   3:             Object[] objects = (Object[]) source;
   4:             int len = objects.length;

View Full Code Here
   1:             {
   2:                 return new ArrayList(((LinkedHashMap)((TableViewer)getViewer()).getInput()).entrySet());
   3:             }
   4: 
   5:             protected void updateStructuredViewerInput(Object input, List elements, List move, boolean isDown)

View Full Code Here
   1: 
   2:         List <Instance> instancesIF = new ArrayList( ((ChoreographyExtension) targetChoreography).getInstances() );
   3:         List <Instance> instancesTHEN = new ArrayList();
   4:         instancesTHEN.addAll(incomingInstances);
   5:         

View Full Code Here
   1: 
   2:         ArrayList commonSRSList = new ArrayList(((MapLayer) mapLayers.get(0)).getFullSRSList());
   3: 
   4:         ...
   5:                 public List getSelectedItems() {
   6:                     List selectedItems = new ArrayList(super.getSelectedItems());
   7: 
   8:         ...
   9:                 public List getItems() {
  10:                     ArrayList items = new ArrayList(items((MapLayerTreeModel.LayerNode) treeModel.getRoot()));

View Full Code Here

Method Details

T[] toArray

public  T[] toArray(T[] a)
Returns an array containing all of the elements in this list in the correct order; the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.

If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the collection is set to null. This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.

Specified by:
T[] toArray in interface List<E>
T[] toArray in interface Collection<E>
Overrides:
T[] toArray in interface AbstractCollection<E>
Parameters:
a - the array into which the elements of the list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
an array containing the elements of the list.
Throws:
ArrayStoreException - if the runtime type of a is not a supertype of the runtime type of every element in this list.

add

public boolean add(E o)
Appends the specified element to the end of this list.
Specified by:
add in interface List<E>
add in interface Collection<E>
Overrides:
add in interface AbstractList<E>
Parameters:
o - element to be appended to this list.
Returns:
true (as per the general contract of Collection.add).
Usages and Demos :

View More Examples of add(E o)
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: 
   6:     ArrayList d2v = new ArrayList();
   7: 
   8:         ...
   9:         d2vfile = fparent + ".d2v";
  10:         d2v.add("DVD2AVIProjectFile");
  11:         ...
  12:         d2v.add("1");

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     protected String[] getSpecificAttributes() {
   6:         ArrayList result = new ArrayList();
   7:         
   8:         String pluginID = getPluginId();
   9:         if (pluginID != null && pluginID.trim().length() > 0)

View Full Code Here
   1: import java.io.StringReader;
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:    {
   6:       ArrayList chunkList = new ArrayList();
   7:       ArrayList parameterList = new ArrayList();
   8:         ...
   9:       {
  10:          chunkList.add("");
  11:       }
  12:         ...
  13:             {
  14:                chunkList.add(chunk.toString());

View Full Code Here
   1: import java.io.*;
   2: import java.util.ArrayList;
   3: import org.eclipse.compare.rangedifferencer.IRangeComparator;
   4:         ...
   5:         String line;
   6:         ArrayList ar = new ArrayList();
   7:         while ((line = br.readLine()) != null) {
   8:         ...
   9:             ar.add(line);
  10:         }

View Full Code Here
   1: import java.awt.*;
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: public class HTMLPanel extends JPanel  implements RecordPanelModel  {
   6:     private ArrayList history = new ArrayList();
   7:     protected JButton okButton = new JButton();
   8:         ...
   9:     public void createNewDocument() {
  10:         history.add("");
  11:         goToLatestDocument();

View Full Code Here

add

public void add(int index,
                E element)
Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
Specified by:
add in interface List<E>
Overrides:
add in interface AbstractList<E>
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
IndexOutOfBoundsException - if index is out of range (index < 0 || index > size()).
Usages and Demos :

View More Examples of add(int index,E element)
   1: import java.lang.reflect.Modifier;
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5:   static String [] findTasks () throws Exception {
   6:     ArrayList tsks = new ArrayList();
   7:     tsks.add(  " AddDoc                   "  );
   8:         ...
   9:     tsks.add(  " SetProp                  "  );
  10:     tsks.add(  " SetProp(name,value)      "  );
  11:     tsks.add(  " Warm                     "  );
  12:         ...
  13:     tsks.add(  "SearchTravRetLoadFieldSelector");
  14:     tsks.add("SearchTravRetLoadFieldSelector(body,title)");

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.List;
   4:         ...
   5:    {
   6:       ArrayList cmdList = new ArrayList();
   7: 
   8:         ...
   9:             "###########################################################");
  10:       cmdList.add("translationMatrix <- function(x,y)");
  11:       cmdList.add("{");
  12:         ...
  13:             "###########################################################");
  14:       cmdList.add("# (x1,y1) first end pt of line");

View Full Code Here

addAll

public boolean addAll(E> c)
Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator. The behavior of this operation is undefined if the specified Collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is this list, and this list is nonempty.)
Specified by:
addAll in interface List<E>
addAll in interface Collection<E>
Overrides:
addAll in interface AbstractCollection<E>
Parameters:
c - the elements to be inserted into this list.
Returns:
true if this list changed as a result of the call.
Throws:
NullPointerException - if the specified collection is null.
Usages and Demos :

View More Examples of addAll(E> c)
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5:         operator = AND_RELATION;
   6:         myPeople = new ArrayList();
   7:     }
   8:         ...
   9:     }
  10:     public ArrayList getCanonicalList() {
  11:         ArrayList list = new ArrayList(1);
  12:         ...
  13:         {
  14:             list.addAll(((People)it.next()).getCanonicalList());        

View Full Code Here
   1:     protected Collection getUrlPatterns(WebBundleDescriptor descriptor) {
   2:     ArrayList patterns=new ArrayList();
   3:         for(Iterator iter=descriptor.getWebComponentDescriptorsSet().iterator();
   4:         ...
   5:                 iter.hasNext();
   6:                     patterns.addAll(((WebComponentDescriptor)iter.next()).getUrlPatternsSet()));
   7:     return patterns;
   8:     }
   9: }

View Full Code Here
   1: import java.nio.ByteBuffer;
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     protected Collection getChildBuffers() {
   6:         ArrayList buffers = new ArrayList();
   7:         buffers.add(ByteBuffer.allocate(4).putInt(menu.size()).flip());
   8:         ...
   9:         for (Iterator iter = menu.iterator(); iter.hasNext();) {
  10:             buffers.addAll(((MenuItem) iter.next()).getBuffers());
  11:         }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.HashMap;
   4:         ...
   5:         if (shadowMungers == null) {
   6:             ArrayList ret = new ArrayList();
   7:             for (Iterator i = members.values().iterator(); i.hasNext(); ) {
   8:         ...
   9:                 ret.addAll(((CrosscuttingMembers)i.next()).getShadowMungers());
  10:             }
  11:         ...
  12:             for (Iterator i = members.values().iterator(); i.hasNext(); ) {
  13:                 ret.addAll(((CrosscuttingMembers)i.next()).getTypeMungers());

View Full Code Here
   1: import java.awt.geom.NoninvertibleTransformException;
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:             Set features = (Set) i.next();
   6:             allFeatures.addAll(features);
   7:         }
   8:         ...
   9:             throws NoninvertibleTransformException {
  10:         ArrayList specifiedFeatures = new ArrayList();
  11:         Map layerToSpecifiedFeaturesMap = layerToSpecifiedFeaturesMap();
  12:         ...
  13: 
  14:             specifiedFeatures.addAll((Collection) layerToSpecifiedFeaturesMap

View Full Code Here

addAll

public boolean addAll(int index,
                      E> c)
Inserts all of the elements in the specified Collection into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified Collection's iterator.
Specified by:
addAll in interface List<E>
Overrides:
addAll in interface AbstractList<E>
Parameters:
index - index at which to insert first element from the specified collection.
c - elements to be inserted into this list.
Returns:
true if this list changed as a result of the call.
Throws:
IndexOutOfBoundsException - if index out of range (index < 0 || index > size()).
NullPointerException - if the specified Collection is null.
Usages and Demos :

View More Examples of addAll(int index,E> c)
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collections;
   4:         ...
   5: 
   6: private void depthFirstTraversal(EditPart part, ArrayList result) {
   7:     if (part.getChildren().isEmpty())
   8:         ...
   9: 
  10:     ArrayList result = new ArrayList();
  11: 
  12:         ...
  13:     if (end > start)
  14:         result.addAll(children.subList(start, end));

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.ArrayList;
   3: import java.util.Arrays;
   4:         ...
   5:         session.setAttribute("searchObject",searchObject);
   6:         ArrayList resultsIDs = new ArrayList();
   7:         ...
   8:         resultsIDs.addAll(remoteAdvancedSearch.performSearch(individualId,searchObject));
   9:         request.setAttribute("displayListFlag","false");

View Full Code Here
   1: 
   2:     private List mListeners = new ArrayList();
   3:     private Set mDialogSettings = new CaseInsensitiveSet();
   4:         ...
   5:     {
   6:         List controlRequiredSettings = new ArrayList();
   7:         ...
   8:         List controlTypes = new ArrayList();
   9:         List dialogSettings = new ArrayList();
  10:         ...
  11:             }
  12:             list.addAll(0,controlRequiredSettings);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5:         FieldDescriptor[] fieldDescriptors = getFieldsForSelect();
   6:         ArrayList columnList = new ArrayList();
   7:         TableAlias searchAlias = getSearchTable();
   8:         ...
   9:             {
  10:                 columnList.addAll(appendListOfColumns(attributes, stmt));
  11:             }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Arrays;
   4:         ...
   5:   Tree tree;
   6:   ArrayList pluginSections;
   7: 
   8:         ...
   9:     
  10:     pluginSections.addAll(0, Arrays.asList(internalSections));
  11: 
  12:         ...
  13:                             public void runSupport() {
  14:                                 ArrayList foundItems = new ArrayList();

View Full Code Here

clear

public void clear()
Removes all of the elements from this list. The list will be empty after this call returns.
Specified by:
clear in interface List<E>
clear in interface Collection<E>
Overrides:
clear in interface AbstractList<E>
Usages and Demos :

View More Examples of clear()
   1:        NodeFollower nf = new NodeFollower();
   2:        ArrayList followers = nf.getTotalFollowers();
   3:        if(followers != null){
   4:         ...
   5:            followers.clear();
   6:        }
   7:         ...
   8:        Node n = new Node();
   9:        ArrayList nodes = n.getTotalNodes();
  10:        if(nodes != null){
  11:         ...
  12:            nodes.clear();

View Full Code Here
   1:     protected int selectedIndex = 0;
   2:     protected ArrayList labels = new ArrayList();
   3:         ...
   4:     protected ArrayList icons = new ArrayList();
   5:     
   6:         ...
   7:     public void clearLabel() {
   8:         labels.clear();
   9:     }
  10:         ...
  11:     public void clearIcon() {
  12:         icons.clear();

View Full Code Here
   1: import java.util.ArrayList;
   2: import java.util.Iterator;
   3:         ...
   4: 
   5:     private ArrayList log = new ArrayList();
   6:     private long testTime;
   7:         ...
   8:     public void clear() {
   9:         log.clear();
  10:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5:     
   6:     private ArrayList fListeners = new ArrayList();
   7:     
   8:         ...
   9:         if (fListeners.size() > 0) {
  10:             fListeners.clear();
  11:         }

View Full Code Here
   1: public class OrderConfirmations {
   2:   ArrayList items = null;
   3: 
   4:         ...
   5:   public OrderConfirmations() {
   6:       items = new ArrayList();
   7:   }
   8:         ...
   9:   protected void finalize() throws Throwable {
  10:       items.clear();
  11:   }
  12:         ...
  13:   public synchronized void clear() {
  14:       items.clear();

View Full Code Here

clone

public Object clone()
Returns a shallow copy of this ArrayList instance. (The elements themselves are not copied.)
Overrides:
clone in interface Object
Returns:
a clone of this ArrayList instance.
Usages and Demos :

View More Examples of clone()
   1:   public static void main(String[] args) {
   2:     ArrayList list1 = new ArrayList(Arrays.asList(
   3:       new String[]{"George", "Jim", "John", "Blake", "Kevin", "Michael"}));
   4:         ...
   5: 
   6:     ArrayList list1Clone1 = (ArrayList)list1.clone();
   7:         ...
   8:     ArrayList list1Clone2 = (ArrayList)list1.clone();

View Full Code Here
   1:   public static void main(String[] args) {
   2:     ArrayList kontejner = new ArrayList();
   3:     for(int i = 0; i < 10; i++ )
   4:         ...
   5:     System.out.println("kontejner: " + kontejner);
   6:     ArrayList kontejner2 = (ArrayList)kontejner.clone();
   7:     for(Iterator sada = kontejner2.iterator();
   8:         sada.hasNext(); )
   9:       ((Int)sada.next()).prirustek();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.HashMap;
   4:         ...
   5:   private HashMap map;
   6:   private ArrayList names;
   7:   private boolean clean;
   8:         ...
   9:     map = new HashMap();
  10:     names = new ArrayList();
  11:     clean = false;
  12:         ...
  13:     {
  14:       map = (HashMap) map.clone();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.List;
   4:         ...
   5:     private Client callBackClient;
   6:     private ArrayList callbacks = new ArrayList();
   7:     private String sessionId;
   8:         ...
   9:         {
  10:             callbackList = (List)callbacks.clone();
  11:             callbacks.clear();

View Full Code Here
   1: import java.awt.event.ActionListener;
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: 
   6:     protected ArrayList listeners = new ArrayList();
   7: 
   8:         ...
   9:                 "Pattern");
  10:         ArrayList list = (ArrayList) listeners.clone();
  11:         ActionListener listener;

View Full Code Here

contains

public boolean contains(Object elem)
Returns true if this list contains the specified element.
Specified by:
contains in interface List<E>
contains in interface Collection<E>
Overrides:
contains in interface AbstractCollection<E>
Parameters:
elem - element whose presence in this List is to be tested.
Returns:
true if the specified element is present; false otherwise.
Usages and Demos :

View More Examples of contains(Object elem)
   1:   private Map listenerList = Collections.synchronizedMap(new WeakHashMap());
   2:   private ArrayList delegate = new ArrayList();
   3: 
   4:         ...
   5:   public boolean contains(Object elem) {
   6:     return delegate.contains(elem);
   7:   }
   8: 
   9:   public int indexOf(Object elem) {

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Enumeration;
   4:         ...
   5: 
   6:   protected ArrayList                        execs_;
   7: 
   8:         ...
   9:   public List getAllExe() {
  10:     return new ArrayList(execs_);
  11:   }
  12:         ...
  13:   public boolean contains(FudaaExec _ex) {
  14:     return execs_.contains(_ex);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.List;
   4:         ...
   5: {
   6:     private ArrayList wantsDiscussion;
   7:     private String headerNumber = "";
   8:         ...
   9:         super(theMessage);
  10:         wantsDiscussion = new ArrayList();
  11:         this.infoItem =
  12:         ...
  13:     {
  14:         return wantsDiscussion.contains(user);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Arrays;
   4:         ...
   5: public class FudaaExecListModel extends AbstractListModel {
   6:   ArrayList l_;
   7: 
   8:         ...
   9:   public FudaaExecListModel(List _l) {
  10:     l_=new ArrayList(_l);
  11:   }
  12:         ...
  13:   public boolean contains(Object _o) {
  14:     return l_.contains(_o);

View Full Code Here
   1: import java.awt.event.MouseEvent;
   2: import java.util.ArrayList;
   3: import java.util.HashSet;
   4:         ...
   5:   private HashSet hoverableComponents = new HashSet();
   6:   private ArrayList enteredComponents = new ArrayList();
   7: 
   8:         ...
   9:           exitAll();
  10:         else if (!((Component) event.getSource()).contains(event.getPoint())) {
  11:           final Point p = SwingUtilities.convertPoint((Component) event.getSource(), event.getPoint(), top);
  12:         ...
  13:     while (c != null) {
  14:       if (hoverableComponents.contains(c)) {

View Full Code Here

ensureCapacity

public void ensureCapacity(int minCapacity)
Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
Parameters:
minCapacity - the desired minimum capacity.
Usages and Demos :

View More Examples of ensureCapacity(int minCapacity)
   1: import java.sql.Types;
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:         if ( reader == null ) return null;
   6:         ArrayList result = new ArrayList();
   7:         try {
   8:         ...
   9:             for ( int i = reader.read( charbuf ); i > 0 ; i = reader.read( charbuf ) ) {
  10:                 result.ensureCapacity( result.size() + BUFFER_SIZE );
  11:                 for ( int charIndex = 0; charIndex < i ; charIndex++ ) {

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: 
   6:     private ArrayList values = new ArrayList(10);
   7: 
   8:         ...
   9:         if (index >= values.size()) {
  10:             values.ensureCapacity(index+1);
  11:             for(int i = values.size(); i<= index; ++i) {

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Arrays;
   4:         ...
   5: public class FudaaExecListModel extends AbstractListModel {
   6:   ArrayList l_;
   7: 
   8:         ...
   9:   public FudaaExecListModel(List _l) {
  10:     l_=new ArrayList(_l);
  11:   }
  12:         ...
  13:   public void ensureCapacity(int _minCapacity) {
  14:     l_.ensureCapacity(_minCapacity);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.io.Serializable;
   4:         ...
   5:     private boolean _hasExplicitRedirectValue = false;
   6:     private ArrayList _actionOutputs;
   7:     private boolean _restoreQueryString;
   8:         ...
   9:         {
  10:             _actionOutputs = new ArrayList( count );
  11:         }
  12:         ...
  13:         {
  14:             _actionOutputs.ensureCapacity( count );

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:   protected ArrayList buffer;
   7: 
   8:         ...
   9:   protected ArrayList removes;
  10: 
  11:         ...
  12:   public void flushBuffer() {
  13:     removes.ensureCapacity(buffer.size());

View Full Code Here

get

public E get(int index)
Returns the element at the specified position in this list.
Specified by:
get in interface List<E>
Overrides:
get in interface AbstractList<E>
Parameters:
index - index of element to return.
Returns:
the element at the specified position in this list.
Throws:
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= size()).
Usages and Demos :

View More Examples of get(int index)
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: 
   6:     protected ArrayList list = null;
   7: 
   8:         ...
   9:     public void setUp() {
  10:         list = (ArrayList) makeEmptyList();
  11:     }
  12:         ...
  13:         try {
  14:             list.get(1);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     {"A","B","C","D","E","F","G","H","I","J","K","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
   6:     private static final ArrayList POINT_LIST = new ArrayList();
   7:     static
   8:         ...
   9:                 if ( index > -1 && index < POINT_LIST.size()-1)
  10:                     return POINT_LIST.get(index+1).toString();
  11:                 else
  12:         ...
  13:                     return POINT_LIST.get(0).toString();

View Full Code Here
   1:   private Map listenerList = Collections.synchronizedMap(new WeakHashMap());
   2:   private ArrayList delegate = new ArrayList();
   3: 
   4:         ...
   5:   public Object getElementAt(int index) {
   6:     return delegate.get(index);
   7:   }
   8:         ...
   9:   public Object elementAt(int index) {
  10:     return delegate.get(index);
  11:   }
  12:         ...
  13:   public Object firstElement() {
  14:     return delegate.get(0);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     
   6:     protected ArrayList list = null;
   7:     
   8:         ...
   9:     public void setUp() {
  10:         list = (ArrayList) makeEmptyList();
  11:     }
  12:         ...
  13:         try {
  14:             list.get(1);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     protected ArrayList m_clauses = new ArrayList(2);
   7:     
   8:         ...
   9:     public Predicate get(int idx) {
  10:         return (Predicate)m_clauses.get(idx);
  11:     }
  12:         ...
  13:         for ( int i=0; i<m_clauses.size(); ++i ) {
  14:             Predicate pp = (Predicate)m_clauses.get(i);

View Full Code Here

indexOf

public int indexOf(Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method.
Specified by:
indexOf in interface List<E>
Overrides:
indexOf in interface AbstractList<E>
Parameters:
elem - an object.
Returns:
the index of the first occurrence of the argument in this list; returns -1 if the object is not found.
Usages and Demos :

View More Examples of indexOf(Object elem)
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5: {
   6:     protected final ArrayList mElements = new ArrayList();
   7: 
   8:         ...
   9:         validateElement(element);
  10:         mElements.add(mElements.indexOf(beforeElement), element);
  11:         return element;
  12:         ...
  13:         validateElement(element);
  14:         int index = mElements.indexOf(afterElement);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     ArrayList _layers = new ArrayList();
   7: 
   8:         ...
   9:     public int indexOf (CanvasLayer layer) {
  10:         return _layers.indexOf(layer);
  11:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Arrays;
   4:         ...
   5: public class FudaaExecListModel extends AbstractListModel {
   6:   ArrayList l_;
   7: 
   8:         ...
   9:   public FudaaExecListModel(List _l) {
  10:     l_=new ArrayList(_l);
  11:   }
  12:         ...
  13:   public int indexOf(Object _o) {
  14:     return l_.indexOf(_o);

View Full Code Here
   1: import java.io.PrintWriter;
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     
   6:     protected ArrayList fExtensions = new ArrayList(1);
   7:     protected ArrayList fExtensionPoints = new ArrayList(1);
   8:         ...
   9:     public int getIndexOf(IPluginExtension e) {
  10:         return fExtensions.indexOf(e);
  11:     }
  12:         ...
  13:         ensureModelEditable();
  14:         int index1 = fExtensions.indexOf(e1);

View Full Code Here
   1: import java.lang.reflect.InvocationTargetException;
   2: import java.util.ArrayList;
   3: import java.util.Collections;
   4:         ...
   5: 
   6:                 ArrayList<String> list = new ArrayList<String>(config.keySet());
   7: 
   8:         ...
   9:             ArrayList list = new ArrayList<Object>(librarian.allEquations());
  10:             return list.indexOf(arg0);
  11:         }

View Full Code Here

isEmpty

public boolean isEmpty()
Tests if this list has no elements.
Specified by:
isEmpty in interface List<E>
isEmpty in interface Collection<E>
Overrides:
isEmpty in interface AbstractCollection<E>
Returns:
true if this list has no elements; false otherwise.
Usages and Demos :

View More Examples of isEmpty()
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public GoalDiscoveryResult() {
   6:         this.goalDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public GoalDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.goalDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public boolean isEmpty() {
  14:         return goalDiscoveryResults.isEmpty();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public ServiceDiscoveryResult() {
   6:         this.serviceDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public ServiceDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.serviceDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public boolean isEmpty() {
  14:         return serviceDiscoveryResults.isEmpty();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public KeywordDiscoveryResult() {
   6:         this.keywordDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public KeywordDiscoveryResult(ArrayList keywordDiscoveryResults) {
  11:         this.keywordDiscoveryResults = keywordDiscoveryResults;
  12:         ...
  13:     public boolean isEmpty() {
  14:         return keywordDiscoveryResults.isEmpty();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: 
   6:         return new ArrayList();
   7:     }
   8:         ...
   9: 
  10:         ArrayList stack = (ArrayList) super.get();
  11:         stack.add(obj);
  12:         ...
  13:         ArrayList stack = (ArrayList) super.get();
  14:         return stack.isEmpty();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public WebServiceDiscoveryResult() {
   6:         this.webServiceDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public WebServiceDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.webServiceDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public boolean isEmpty() {
  14:         return webServiceDiscoveryResults.isEmpty();

View Full Code Here

lastIndexOf

public int lastIndexOf(Object elem)
Returns the index of the last occurrence of the specified object in this list.
Specified by:
lastIndexOf in interface List<E>
Overrides:
lastIndexOf in interface AbstractList<E>
Parameters:
elem - the desired element.
Returns:
the index of the last occurrence of the specified object in this list; returns -1 if the object is not found.
Usages and Demos :

View More Examples of lastIndexOf(Object elem)
   1:   private Map listenerList = Collections.synchronizedMap(new WeakHashMap());
   2:   private ArrayList delegate = new ArrayList();
   3: 
   4:         ...
   5:   public int lastIndexOf(Object elem) {
   6:     return delegate.lastIndexOf(elem);
   7:   }
   8: 
   9:   public Object elementAt(int index) {

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.ArrayList;
   3: import java.util.List;
   4:         ...
   5:     private static final class CtxStack {
   6:         private ArrayList stack_ = new ArrayList();
   7: 
   8:         ...
   9:             }
  10:             stack_.remove(stack_.lastIndexOf(context)); 
  11:         }
  12:         ...
  13: 
  14:         holder.remove(holder.lastIndexOf(theContext));

View Full Code Here
   1: import java.io.Serializable;
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5: 
   6: public class FastArrayList extends ArrayList {
   7: 
   8:         ...
   9:         super();
  10:         this.list = new ArrayList();
  11: 
  12:         ...
  13:         if (fast) {
  14:             return (list.lastIndexOf(element));

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5: 
   6: public class FastArrayList extends ArrayList {
   7: 
   8:         ...
   9:         super();
  10:         this.list = new ArrayList();
  11: 
  12:         ...
  13:         if (fast) {
  14:             return (list.lastIndexOf(element));

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5: 
   6: public class FastArrayList extends ArrayList {
   7: 
   8:         ...
   9:         super();
  10:         this.list = new ArrayList();
  11: 
  12:         ...
  13:         if (fast) {
  14:             return (list.lastIndexOf(element));

View Full Code Here

remove

public E remove(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
Specified by:
remove in interface List<E>
Overrides:
remove in interface AbstractList<E>
Parameters:
index - the index of the element to removed.
Returns:
the element that was removed from the list.
Throws:
IndexOutOfBoundsException - if index out of range (index < 0 || index >= size()).
Usages and Demos :

View More Examples of remove(int index)
   1: 
   2:     ArrayList l = new ArrayList();
   3: 
   4:         ...
   5:                 message("MISSED " + i.message + " at " + i.due);
   6:             l.remove(0);
   7:         }
   8:         System.exit(0);
   9:     }

View Full Code Here
   1:  
   2:     ArrayList l = new ArrayList(); 
   3:  
   4:         ...
   5:                 message("MANQU? : " + i.message + " ? " + i.due); 
   6:             l.remove(0); 
   7:         } 
   8:         System.exit(0); 
   9:     } 

View Full Code Here
   1: import java.awt.BorderLayout;
   2: import java.util.ArrayList;
   3: import java.util.HashMap;
   4:         ...
   5:         for (int i = 0; i < newValues.length; i++) {
   6:             ArrayList history = (ArrayList) _lookup.get(names[i]);
   7:             if (history == null) {
   8:         ...
   9:                     n--;
  10:                     history.remove(0);
  11:                     

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5: {
   6:     public ArrayList iterators = new ArrayList();
   7:     
   8:         ...
   9:             }
  10:             iterators.remove(0);
  11:         }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.ListIterator;
   4:         ...
   5: 
   6:     ArrayList keyword_queue = new ArrayList();
   7:     int queue_count = 0;
   8:         ...
   9:         {
  10:           keyword_queue.remove(0);
  11:           queue_count--;

View Full Code Here

remove

public boolean remove(Object o)
Removes a single instance of the specified element from this list, if it is present (optional operation). More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if the list contains one or more such elements. Returns true if the list contained the specified element (or equivalently, if the list changed as a result of the call).

Specified by:
remove in interface List<E>
remove in interface Collection<E>
Overrides:
remove in interface AbstractCollection<E>
Parameters:
o - element to be removed from this list, if present.
Returns:
true if the list contained the specified element.
Usages and Demos :

View More Examples of remove(Object o)
   1: 
   2:     ArrayList l = new ArrayList();
   3: 
   4:         ...
   5:                 message("MISSED " + i.message + " at " + i.due);
   6:             l.remove(0);
   7:         }
   8:         System.exit(0);
   9:     }

View Full Code Here
   1:  
   2:     ArrayList l = new ArrayList(); 
   3:  
   4:         ...
   5:                 message("MANQU? : " + i.message + " ? " + i.due); 
   6:             l.remove(0); 
   7:         } 
   8:         System.exit(0); 
   9:     } 

View Full Code Here
   1: import java.awt.BorderLayout;
   2: import java.util.ArrayList;
   3: import java.util.HashMap;
   4:         ...
   5:         for (int i = 0; i < newValues.length; i++) {
   6:             ArrayList history = (ArrayList) _lookup.get(names[i]);
   7:             if (history == null) {
   8:         ...
   9:                     n--;
  10:                     history.remove(0);
  11:                     

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5: {
   6:     public ArrayList iterators = new ArrayList();
   7:     
   8:         ...
   9:             }
  10:             iterators.remove(0);
  11:         }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.ListIterator;
   4:         ...
   5: 
   6:     ArrayList keyword_queue = new ArrayList();
   7:     int queue_count = 0;
   8:         ...
   9:         {
  10:           keyword_queue.remove(0);
  11:           queue_count--;

View Full Code Here

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)
Overrides:
removeRange in interface AbstractList<E>
Parameters:
fromIndex - index of first element to be removed.
toIndex - index after last element to be removed.

set

public E set(int index,
             E element)
Replaces the element at the specified position in this list with the specified element.
Specified by:
set in interface List<E>
Overrides:
set in interface AbstractList<E>
Parameters:
index - index of element to replace.
element - element to be stored at the specified position.
Returns:
the element previously at the specified position.
Throws:
IndexOutOfBoundsException - if index out of range (index < 0 || index >= size()).
Usages and Demos :

View More Examples of set(int index,E element)
   1: public class GlyfWriter extends FontFormatWriter {
   2:     private ArrayList m_glyphs = new ArrayList();
   3:     private LocaWriter m_loca;
   4:         ...
   5:     public void write() throws IOException {
   6:         m_glyphs.set(0, m_notdef);
   7:         
   8:         m_maxp.setNumGlyphs(numOfGlyph());
   9:         m_loca.m_offsets.clear();

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.ArrayList;
   3: import java.util.HashMap;
   4:         ...
   5: 
   6:     private ArrayList items = new ArrayList();
   7: 
   8:         ...
   9:         }
  10:         items.set(0, method + ' ' + uri + ' ' + protocol);
  11:         ...
  12:         items.set(1, method);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.HashMap;
   4:         ...
   5: public class ContentQuery implements Query {
   6:     final protected ArrayList constraintList;
   7: 
   8:         ...
   9:         this.type = type;
  10:         constraintList = new ArrayList();
  11:         constraintList.add(null);
  12:         ...
  13:     final public void setAnchorConstraint(AnchorConstraint anchorConstraint) {
  14:         constraintList.set(0, anchorConstraint);

View Full Code Here
   1: import java.io.IOException;
   2: import java.util.ArrayList;
   3: import java.util.HashMap;
   4:         ...
   5:         if (zrec.hasRuleReference()) {
   6:         ArrayList rrecs = zrec.getRuleRef().getRules(startYear);
   7: 
   8:         ...
   9:             if (r0.getSave() == 0 && r1.getSave() > 0) {
  10:             rrecs.set(0, r1);
  11:         ...
  12:             rrecs.set(1, r0);

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: final class MCRCM8Item implements DKConstantICM {
   6:     private ArrayList ddolist = new ArrayList();
   7: 
   8:         ...
   9: 
  10:         ddolist.set(0, iter.next());

View Full Code Here

size

public int size()
Returns the number of elements in this list.
Specified by:
size in interface List<E>
size in interface Collection<E>
Overrides:
size in interface AbstractCollection<E>
Returns:
the number of elements in this list.
Usages and Demos :

View More Examples of size()
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     
   6:     ArrayList listeners = creation_listeners_cow;
   7:         ...
   8:     for( int i=0; i < listeners.size(); i++ ) {
   9:       CreationListener listener = (CreationListener)listeners.get( i );
  10:         ...
  11:     try{  creation_listeners_mon.enter();
  12:       ArrayList newlist = new ArrayList( creation_listeners_cow.size() + 1 );

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     private static IDiffElement[] fgEmptyArray= new IDiffElement[0];
   6:     private ArrayList fChildren;
   7:     
   8:         ...
   9:         if (fChildren == null)
  10:             fChildren= new ArrayList();
  11:         fChildren.add(diff);
  12:         ...
  13:             child.setParent(null);
  14:             if (fChildren.size() == 0) {

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Stack;
   4:         ...
   5: 
   6:     private ArrayList list = new ArrayList();
   7: 
   8:         ...
   9: 
  10:         ArrayList mergedList = new ArrayList(list.size());
  11:         ...
  12:         for (int i = 0; i < list.size(); i++) {

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Stack;
   4:         ...
   5: 
   6:     private ArrayList list = new ArrayList();
   7: 
   8:         ...
   9: 
  10:         ArrayList mergedList = new ArrayList(list.size());
  11:         ...
  12:         for (int i = 0; i < list.size(); i++) {

View Full Code Here
   1: package org.cougaar.mts.base;
   2: import java.util.ArrayList;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     public synchronized ArrayList flushMessages() {
   7:         ...
   8:     ArrayList droppedMessages = new ArrayList();
   9:     link.flushMessages(droppedMessages);
  10:         ...
  11:     ArrayList rawMessages = new ArrayList(droppedMessages.size());

View Full Code Here

toArray

public Object[] toArray()
Returns an array containing all of the elements in this list in the correct order.
Specified by:
toArray in interface List<E>
toArray in interface Collection<E>
Overrides:
toArray in interface AbstractCollection<E>
Returns:
an array containing all of the elements in this list in the correct order.
Usages and Demos :

View More Examples of toArray()
   1: 
   2: import java.util.ArrayList;
   3: import java.util.concurrent.CountDownLatch;
   4:         ...
   5:     
   6:     private ArrayList results_ = new ArrayList();
   7:     
   8:         ...
   9:     public Object[] getResults() {
  10:         return results_.toArray();
  11:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     private static final long serialVersionUID = 1L;
   6:     protected ArrayList children= new ArrayList();
   7:     public BookmarkFolder() {
   8:         ...
   9:     public Object[] getChildren(Object parent) {
  10:         return children.toArray();
  11:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public GoalDiscoveryResult() {
   6:         this.goalDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public GoalDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.goalDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public Object[] toArray() { 
  14:         return goalDiscoveryResults.toArray();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5:     public Object[] getElements(Object inputElement) {
   6:         ArrayList all= new ArrayList();
   7:         addAll(all, (TestRoot) inputElement);
   8:         ...
   9:         return all.toArray();
  10:     }

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: import java.util.Collection;
   4:         ...
   5:     public ServiceDiscoveryResult() {
   6:         this.serviceDiscoveryResults = new ArrayList();
   7:     }
   8:         ...
   9: 
  10:     public ServiceDiscoveryResult(ArrayList goalDiscoveryResults) {
  11:         this.serviceDiscoveryResults = goalDiscoveryResults;
  12:         ...
  13:     public Object[] toArray() {
  14:         return serviceDiscoveryResults.toArray();

View Full Code Here

trimToSize

public void trimToSize()
Trims the capacity of this ArrayList instance to be the list's current size. An application can use this operation to minimize the storage of an ArrayList instance.
Usages and Demos :

View More Examples of trimToSize()
   1: 
   2: import java.util.ArrayList;
   3: import java.util.List;
   4:         ...
   5: extends ClassTreeNodeImpl {
   6:     private final ArrayList children;
   7: 
   8:         ...
   9:         super(aParent);
  10:         children = new ArrayList();
  11:     }
  12:         ...
  13:     public void trimToSize() {
  14:         children.trimToSize();

View Full Code Here
   1:     private BSPTree.Leaf back;
   2:     private ArrayList neighbors;
   3:     private Vector3D midPoint;
   4:         ...
   5:     public void buildNeighborList() {
   6:         neighbors = new ArrayList();
   7:         if (front != null) {
   8:         ...
   9: 
  10:         neighbors.trimToSize();
  11:         while (neighbors.remove(this));

View Full Code Here
   1: import java.io.Serializable;
   2: import java.util.ArrayList;
   3: import java.util.List;
   4:         ...
   5: 
   6:    private List listOfRowLists = new ArrayList();
   7: 
   8:         ...
   9:       if (rowList == null) {
  10:          rowList = new ArrayList();
  11:          listSet(listOfRowLists, row, rowList);
  12:         ...
  13:       else
  14:          rowList.trimToSize();

View Full Code Here
   1: 
   2: import java.util.ArrayList;
   3: 
   4:         ...
   5: 
   6:     protected ArrayList fRootElements;
   7: public Region() {
   8:         ...
   9:     fRootElements = new ArrayList(1);
  10: }
  11:         ...
  12:         fRootElements.add(element);
  13:         fRootElements.trimToSize();

View Full Code Here
   1:   private Map listenerList = Collections.synchronizedMap(new WeakHashMap());
   2:   private ArrayList delegate = new ArrayList();
   3: 
   4:         ...
   5:   public void trimToSize() {
   6:     delegate.trimToSize();
   7:   }
   8: 
   9:   public void ensureCapacity(int minCapacity) {

View Full Code Here