Java Doc for ArrayListFoundation.java in  » Science » Cougaar12_4 » org » cougaar » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.AbstractList
   org.cougaar.util.ArrayListFoundation

All known Subclasses:   org.cougaar.util.TimeSpanSet,
ArrayListFoundation
public class ArrayListFoundation extends AbstractList implements List,Cloneable,java.io.Serializable(Code)
A copy of java.util.ArrayList, modified so that previously private data members are here declared protected and which does not use iterators to walk itself p> This allows extending classes to have efficient access to the actual data storage elements so that the supported API extensions have first-class access.
See Also:   java.util.ArrayList


Field Summary
protected transient  ObjectelementData
     The array buffer into which the elements of the ArrayListFoundation are stored.
protected transient  intsize
     The size of the ArrayListFoundation (the number of elements it contains).

Constructor Summary
public  ArrayListFoundation(int initialCapacity)
     Constructs an empty list with the specified initial capacity.
public  ArrayListFoundation()
     Constructs an empty list.
public  ArrayListFoundation(Collection c)
     Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Method Summary
public  booleanadd(Object o)
     Appends the specified element to the end of this list.
Parameters:
  o - element to be appended to this list.
public  voidadd(int index, Object element)
     Inserts the specified element at the specified position in this list.
public  booleanaddAll(Collection 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.
public  booleanaddAll(int index, Collection c)
     Inserts all of the elements in the specified Collection into this list, starting at the specified position.
public  voidclear()
     Removes all of the elements from this list.
public  Objectclone()
     Returns a shallow copy of this ArrayListFoundation instance.
public  booleancontains(Object elem)
     Returns true if this list contains the specified element.
public synchronized  voidensureCapacity(int minCapacity)
     Increases the capacity of this ArrayListFoundation instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
public  booleanequals(Object o)
     Compares the specified object with this list for equality.
public  Objectget(int index)
     Returns the element at the specified position in this list.
Parameters:
  index - index of element to return.
public  inthashCode()
     Returns the hash code value for this list.
public  intindexOf(Object elem)
     Searches for the first occurence of the given argument, testing for equality using the equals method.
public  booleanisEmpty()
     Tests if this list has no elements.
public  intlastIndexOf(Object elem)
     Returns the index of the last occurrence of the specified object in this list.
Parameters:
  elem - the desired element.
public  booleanremove(Object o)
     Removes a single instance of the specified element from this collection, if it is present (optional operation).
public  Objectremove(int index)
     Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
Parameters:
  index - the index of the element to removed.
public  booleanremoveAll(Collection c)
     Removes from this collection all of its elements that are contained in the specified collection (optional operation).

This implementation walks the elements of this collection, checking each element in turn to see if it's contained in the specified collection.

protected  voidremoveRange(int fromIndex, int toIndex)
     Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
public  booleanretainAll(Collection c)
     Retains only the elements in this collection that are contained in the specified collection (optional operation).
public  Objectset(int index, Object element)
     Replaces the element at the specified position in this list with the specified element.
Parameters:
  index - index of element to replace.
Parameters:
  element - element to be stored at the specified position.
public  intsize()
     Returns the number of elements in this list.
public  Object[]toArray()
     Returns an array containing all of the elements in this list in the correct order.
public  Object[]toArray(Object a)
     Returns an array containing all of the elements in this list in the correct order.
public  StringtoString()
     Returns a string representation of this collection.
public  voidtrimToSize()
     Trims the capacity of this ArrayListFoundation instance to be the list's current size.

Field Detail
elementData
protected transient Object elementData(Code)
The array buffer into which the elements of the ArrayListFoundation are stored. The capacity of the ArrayListFoundation is the length of this array buffer.



size
protected transient int size(Code)
The size of the ArrayListFoundation (the number of elements it contains).




Constructor Detail
ArrayListFoundation
public ArrayListFoundation(int initialCapacity)(Code)
Constructs an empty list with the specified initial capacity.
Parameters:
  initialCapacity - the initial capacity of the list.



ArrayListFoundation
public ArrayListFoundation()(Code)
Constructs an empty list.



ArrayListFoundation
public ArrayListFoundation(Collection c)(Code)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. The ArrayListFoundation instance has an initial capacity of 110% the size of the specified collection.




Method Detail
add
public boolean add(Object o)(Code)
Appends the specified element to the end of this list.
Parameters:
  o - element to be appended to this list. true (as per the general contract of Collection.add).



add
public void add(int index, Object element)(Code)
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).
Parameters:
  index - index at which the specified element is to be inserted.
Parameters:
  element - element to be inserted.
throws:
  IndexOutOfBoundsException - if index is out of range(index < 0 || index > size()).



addAll
public boolean addAll(Collection c)(Code)
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.)
Parameters:
  c - elements to be inserted into this list.
throws:
  IndexOutOfBoundsException - if index out of range (index< 0 || index > size()).



addAll
public boolean addAll(int index, Collection c)(Code)
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.
Parameters:
  index - index at which to insert first elementfrom the specified collection.
Parameters:
  c - elements to be inserted into this list.
throws:
  IndexOutOfBoundsException - if index out of range (index< 0 || index > size()).



clear
public void clear()(Code)
Removes all of the elements from this list. The list will be empty after this call returns.



clone
public Object clone()(Code)
Returns a shallow copy of this ArrayListFoundation instance. (The elements themselves are not copied.) a clone of this ArrayListFoundation instance.



contains
public boolean contains(Object elem)(Code)
Returns true if this list contains the specified element.
Parameters:
  elem - element whose presence in this List is to be tested.



ensureCapacity
public synchronized void ensureCapacity(int minCapacity)(Code)
Increases the capacity of this ArrayListFoundation 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.



equals
public boolean equals(Object o)(Code)
Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. (Two elements e1 and e2 are equal if (e1==null ? e2==null : e1.equals(e2)).) In other words, two lists are defined to be equal if they contain the same elements in the same order.

This implementation first checks if the specified object is this list. If so, it returns true; if not, it checks if the specified object is a list. If not, it returns false; if so, it iterates over both lists, comparing corresponding pairs of elements. If any comparison returns false, this method returns false. If either iterator runs out of elements before the other it returns false (as the lists are of unequal length); otherwise it returns true when the iterations complete.
Parameters:
  o - the object to be compared for equality with this list. true if the specified object is equal to this list.




get
public Object get(int index)(Code)
Returns the element at the specified position in this list.
Parameters:
  index - index of element to return. the element at the specified position in this list.
throws:
  IndexOutOfBoundsException - if index is out of range (index< 0 || index >= size()).



hashCode
public int hashCode()(Code)
Returns the hash code value for this list.

This implementation uses exactly the code that is used to define the list hash function in the documentation for the List.hashCode method. the hash code value for this list.




indexOf
public int indexOf(Object elem)(Code)
Searches for the first occurence of the given argument, testing for equality using the equals method.
Parameters:
  elem - an object. the index of the first occurrence of the argument in thislist; returns -1 if the object is not found.
See Also:   Object.equals(Object)



isEmpty
public boolean isEmpty()(Code)
Tests if this list has no elements. true if this list has no elements;false otherwise.



lastIndexOf
public int lastIndexOf(Object elem)(Code)
Returns the index of the last occurrence of the specified object in this list.
Parameters:
  elem - the desired element. the index of the last occurrence of the specified object inthis list; returns -1 if the object is not found.



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

This implementation walks the elements of the collection looking for the specified element. If it finds the element, it removes the element from the collection.


Parameters:
  o - element to be removed from this collection, if present. true if the collection contained the specifiedelement.




remove
public Object remove(int index)(Code)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
Parameters:
  index - the index of the element to removed. the element that was removed from the list.
throws:
  IndexOutOfBoundsException - if index out of range (index< 0 || index >= size()).



removeAll
public boolean removeAll(Collection c)(Code)
Removes from this collection all of its elements that are contained in the specified collection (optional operation).

This implementation walks the elements of this collection, checking each element in turn to see if it's contained in the specified collection. If it's so contained, it's removed from this collection.


Parameters:
  c - elements to be removed from this collection. true if this collection changed as a result of thecall.
See Also:   ArrayListFoundation.remove(Object)
See Also:   ArrayListFoundation.contains(Object)




removeRange
protected void removeRange(int fromIndex, int toIndex)(Code)
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.)
Parameters:
  fromIndex - index of first element to be removed.
Parameters:
  toIndex - index after last element to be removed.



retainAll
public boolean retainAll(Collection c)(Code)
Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.

This implementation walks the elements of this collection, checking each element returned in turn to see if it's contained in the specified collection. If it's not so contained, it's removed from this collection. true if this collection changed as a result of thecall.
See Also:   ArrayListFoundation.remove(Object)
See Also:   ArrayListFoundation.contains(Object)




set
public Object set(int index, Object element)(Code)
Replaces the element at the specified position in this list with the specified element.
Parameters:
  index - index of element to replace.
Parameters:
  element - element to be stored at the specified position. the element previously at the specified position.
throws:
  IndexOutOfBoundsException - if index out of range(index < 0 || index >= size()).



size
public int size()(Code)
Returns the number of elements in this list. the number of elements in this list.



toArray
public Object[] toArray()(Code)
Returns an array containing all of the elements in this list in the correct order. an array containing all of the elements in this listin the correct order.



toArray
public Object[] toArray(Object a)(Code)
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.
Parameters:
  a - the array into which the elements of the list are tobe stored, if it is big enough; otherwise, a new array of thesame runtime type is allocated for this purpose. an array containing the elements of the list.
throws:
  ArrayStoreException - if the runtime type of a is not a supertypeof the runtime type of every element in this list.




toString
public String toString()(Code)
Returns a string representation of this collection. The string representation consists of a list of the collection's elements, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings as by String.valueOf(Object).

This implementation creates an empty string buffer, appends a left square bracket, and walks the elements of the collection appending the string representation of each element in turn. After appending each element except the last, the string ", " is appended. Finally a right bracket is appended. A string is obtained from the string buffer, and returned. a string representation of this collection.




trimToSize
public void trimToSize()(Code)
Trims the capacity of this ArrayListFoundation instance to be the list's current size. An application can use this operation to minimize the storage of an ArrayListFoundation instance.



Fields inherited from java.util.AbstractList
protected transient int modCount(Code)(Java Doc)

Methods inherited from java.util.AbstractList
public boolean add(E e)(Code)(Java Doc)
public void add(int index, E element)(Code)(Java Doc)
public boolean addAll(int index, Collection<? extends E> c)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
abstract public E get(int index)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public int indexOf(Object o)(Code)(Java Doc)
public Iterator<E> iterator()(Code)(Java Doc)
public int lastIndexOf(Object o)(Code)(Java Doc)
public ListIterator<E> listIterator()(Code)(Java Doc)
public ListIterator<E> listIterator(int index)(Code)(Java Doc)
public E remove(int index)(Code)(Java Doc)
protected void removeRange(int fromIndex, int toIndex)(Code)(Java Doc)
public E set(int index, E element)(Code)(Java Doc)
public List<E> subList(int fromIndex, int toIndex)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.