org.openmobileis.common.util.collection.Array Class Reference

Inheritance diagram for org.openmobileis.common.util.collection.Array:

org.openmobileis.common.util.collection.FilterCollection

List of all members.


Detailed Description

Use to store an Array of objects.

Author:
Philippe Delrieu
Since:
JDK 1.1
Version:
1.0.

Definition at line 40 of file Array.java.


Public Member Functions

 Array (int initialCapacity)
 Constructs an empty ArrayList with the specified initial capacity.
 Array ()
 Constructs an empty ArrayList.Initial capacity is 10.
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.
int size ()
 Returns the number of elements in this ArrayList.
void setSize (int size)
 set the size of the array.
boolean isEmpty ()
 Tests if this ArrayList has no elements.
Object[] toArray ()
 Returns an array containing all of the elements in this ArrayList in the correct order.
Object[] toArray (Object a[])
 Returns an array containing all of the elements in this ArrayList in the correct order.
Object get (int index)
 Returns the element at the specified position in this ArrayList.
boolean add (Object o)
 Appends the specified element to the end of this ArrayList.
boolean replace (int index, Object o)
 replace at the specified index the element.
boolean add (int index, Object o)
 Appends the specified element to the end of this ArrayList.
Object getLastAdded ()
 return the last added object in the array.
boolean contains (Object o)
 return true if the array contains the specified object false otherwise.
int indexOf (Object o)
 Searches for the first occurence of the given argument, testing for equality using the equals method.
boolean addArray (Array a)
 Appends the specified ArrayList to the end of this ArrayList.
Object remove (int index)
 Removes the element at the specified position in this ArrayList.
Object remove (Object element)
 Removes the element in this ArrayList.

Protected Attributes

Object elementData []
 The array buffer into which the elements of the ArrayList are stored.
int size
 The size of the ArrayList (the number of elements it contains).

Constructor & Destructor Documentation

org.openmobileis.common.util.collection.Array.Array ( int  initialCapacity  ) 

Constructs an empty ArrayList with the specified initial capacity.

Parameters:
initialCapacity the initial capacity of the ArrayList.
Exceptions:
IllegalArgumentException if the specified initial capacity is negative

Definition at line 74 of file Array.java.


Member Function Documentation

void org.openmobileis.common.util.collection.Array.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.

Definition at line 110 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

Referenced by org.openmobileis.common.util.collection.Array.add().

int org.openmobileis.common.util.collection.Array.size (  ) 

Returns the number of elements in this ArrayList.

Returns:
the number of elements in this ArrayList.

Definition at line 127 of file Array.java.

Referenced by org.openmobileis.common.util.collection.Array.add(), org.openmobileis.common.util.collection.Array.addArray(), org.openmobileis.common.util.collection.Array.contains(), org.openmobileis.common.util.collection.Array.ensureCapacity(), org.openmobileis.common.util.collection.Array.getLastAdded(), org.openmobileis.common.util.collection.Array.indexOf(), org.openmobileis.common.util.collection.Array.isEmpty(), org.openmobileis.common.util.collection.Array.remove(), org.openmobileis.common.util.collection.Array.replace(), and org.openmobileis.common.util.collection.Array.toArray().

void org.openmobileis.common.util.collection.Array.setSize ( int  size  ) 

set the size of the array.

All element after the size are removed.

Definition at line 134 of file Array.java.

boolean org.openmobileis.common.util.collection.Array.isEmpty (  ) 

Tests if this ArrayList has no elements.

Returns:
true if this ArrayList has no elements; false otherwise.

Definition at line 144 of file Array.java.

References org.openmobileis.common.util.collection.Array.size().

Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteObjectWithId(), org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteSingleElement(), and org.openmobileis.database.fastobjectdb.db.FODBCollection.replaceElement().

Object [] org.openmobileis.common.util.collection.Array.toArray (  ) 

Returns an array containing all of the elements in this ArrayList in the correct order.

Returns:
an array containing all of the elements in this ArrayList in the correct order.

Definition at line 155 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

Referenced by org.openmobileis.synchro.openmsp.client.db.DBImportFileCoder.decodeData(), org.openmobileis.synchro.openmsp.client.db.DBImportFileCoder.decodeFileData(), org.openmobileis.synchro.algo.replication.utils.DefaultSynchroAtomicObjectDelegate.getAllModifiedAtomicObjectForServiceSince(), and org.openmobileis.common.util.collection.Sort.returnANotInB().

Object [] org.openmobileis.common.util.collection.Array.toArray ( Object  a[]  ) 

Returns an array containing all of the elements in this ArrayList in the correct order.

The runtime type of the returned array is that of the specified array. If the ArrayList 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 ArrayList.

If the ArrayList fits in the specified array with room to spare (i.e., the ArrayList has more elements than the array), the element in the array immediately following the end of the collection is set to null.

Parameters:
a the array into which the elements of the ArrayList 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 ArrayList.
Exceptions:
ArrayStoreException if the runtime type of a is not a supertype of the runtime type of every element in this ArrayList.

Definition at line 180 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

Object org.openmobileis.common.util.collection.Array.get ( int  index  ) 

Returns the element at the specified position in this ArrayList.

Parameters:
index index of element to return.
Returns:
the element at the specified position in this ArrayList.
Exceptions:
IndexOutOfBoundsException if index is out of range (index < 0 || index >= size()).

Definition at line 203 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData.

Referenced by org.openmobileis.database.fastobjectdb.db.index.FODBIndex.add(), org.openmobileis.examples.mycrm.terminal.services.DisplayAccountService.addContent(), org.openmobileis.database.fastobjectdb.db.FODBCollection.addElement(), org.openmobileis.database.fastobjectdb.db.query.soda.SodaStringIndexComparator.compareTo(), org.openmobileis.database.fastobjectdb.db.query.soda.SodaLongIndexComparator.compareTo(), org.openmobileis.database.fastobjectdb.db.query.soda.SodaIntIndexComparator.compareTo(), org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteObjectWithId(), org.openmobileis.database.fastobjectdb.db.FODBCollection.deleteSingleElement(), org.openmobileis.database.fastobjectdb.db.index.FODBIndex.delObjectWithKey(), org.openmobileis.services.common.CallingServiceManager.getCallingServiceParameters(), org.openmobileis.embedded.webserver.templates.Freemarkerv1TemplateDelegate.getTemplate(), org.openmobileis.database.fastobjectdb.db.query.soda.SodaStringIndexComparator.isSelected(), org.openmobileis.database.fastobjectdb.db.query.soda.SodaLongIndexComparator.isSelected(), org.openmobileis.database.fastobjectdb.db.query.soda.SodaIntIndexComparator.isSelected(), org.openmobileis.synchro.openmsp.client.core.test.TestListenerOrdonancer.main(), org.openmobileis.services.common.CallingServiceManager.peekCallingService(), org.openmobileis.module.terminal.ModuleJarSyncListener.receiveResultCommand(), org.openmobileis.common.util.collection.tree.DependTree.removeObjectByName(), org.openmobileis.database.fastobjectdb.db.FODBCollection.replaceElement(), org.openmobileis.synchro.openmsp.client.services.SynchroJournalDisplayService.runTemplate(), org.openmobileis.examples.mycrm.terminal.services.SearchAccountService.runTemplate(), org.openmobileis.services.servlet.IndexServlet.runTemplate(), org.openmobileis.examples.mycrm.terminal.services.DisplayContactService.runTemplate(), org.openmobileis.examples.mycrm.terminal.services.DisplayAccountService.runTemplate(), and org.openmobileis.bundle.osgi.synchro.SynchroBundleActivator.start().

boolean org.openmobileis.common.util.collection.Array.add ( Object  o  ) 

Appends the specified element to the end of this ArrayList.

Parameters:
o element to be appended to this ArrayList.
Returns:
true.

Implements org.openmobileis.common.util.collection.FilterCollection.

Definition at line 215 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, org.openmobileis.common.util.collection.Array.ensureCapacity(), and org.openmobileis.common.util.collection.Array.size().

Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.addIndex(), org.openmobileis.common.context.ApplicationContextManager.addManager(), org.openmobileis.synchro.openmsp.client.db.DBImportFileCoder.decodeData(), org.openmobileis.synchro.openmsp.client.db.DBImportFileCoder.decodeFileData(), org.openmobileis.examples.mycrm.data.jdbc.MyCrmLabelSynchroTarget.getAllCollectionObject(), org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getAllCollectionObject(), org.openmobileis.examples.server.synchro.BaseDataFODBSyncTarget.getAllCollectionObject(), org.openmobileis.synchro.algo.replication.utils.DefaultSynchroAtomicObjectDelegate.getAllModifiedAtomicObjectForServiceSince(), org.openmobileis.embedded.webserver.templates.Freemarkerv1TemplateDelegate.init(), org.openmobileis.modules.profiles.terminal.RubricLoader.loadService(), org.openmobileis.services.common.CallingServiceManager.peekToTheSpecifiedCallingService(), org.openmobileis.services.common.CallingServiceManager.pushCallingService(), org.openmobileis.module.terminal.ModuleJarSyncListener.receiveResultCommand(), and org.openmobileis.common.util.collection.Sort.returnANotInB().

boolean org.openmobileis.common.util.collection.Array.replace ( int  index,
Object  o 
)

replace at the specified index the element.

if there is no element at index add the new one at the end of the array.

Parameters:
index index in the array where element is replaced.
o element to be replaced to this ArrayList.
Returns:
true.

Definition at line 229 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

boolean org.openmobileis.common.util.collection.Array.add ( int  index,
Object  o 
)

Appends the specified element to the end of this ArrayList.

Parameters:
o element to be appended to this ArrayList.
Returns:
true.

Definition at line 243 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, org.openmobileis.common.util.collection.Array.ensureCapacity(), and org.openmobileis.common.util.collection.Array.size().

Object org.openmobileis.common.util.collection.Array.getLastAdded (  ) 

return the last added object in the array.

Parameters:
@return last added Object.

Definition at line 257 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

boolean org.openmobileis.common.util.collection.Array.contains ( Object  o  ) 

return true if the array contains the specified object false otherwise.

Parameters:
Object o : the object to be tested. O must implements equals method
Returns:
true if the specified object is inside the array.

Definition at line 270 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

Referenced by org.openmobileis.database.fastobjectdb.db.FODBCollection.addIndex().

int org.openmobileis.common.util.collection.Array.indexOf ( Object  o  ) 

Searches for the first occurence of the given argument, testing for equality using the equals method.

return the index of the occurence, -1 if not found

Parameters:
Object o : the object to be searched. O must implements equals method
Returns:
index of the first occurence, -1 if not found.

Definition at line 286 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

boolean org.openmobileis.common.util.collection.Array.addArray ( Array  a  ) 

Appends the specified ArrayList to the end of this ArrayList.

Parameters:
a ArrayList to be appended to this ArrayList..
Returns:
true.

Definition at line 301 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

Object org.openmobileis.common.util.collection.Array.remove ( int  index  ) 

Removes the element at the specified position in this ArrayList.

Shifts any subsequent elements to the left (subtracts one from their indices).

Parameters:
index the index of the element to removed.
Returns:
the element that was removed from the ArrayList.
Exceptions:
IndexOutOfBoundsException if index out of range (index < 0 || index >= size()).

Definition at line 321 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData, and org.openmobileis.common.util.collection.Array.size().

Referenced by org.openmobileis.services.common.CallingServiceManager.peekToTheSpecifiedCallingService(), org.openmobileis.services.common.CallingServiceManager.popCallingService(), and org.openmobileis.common.util.collection.tree.DependTree.removeObjectByName().

Object org.openmobileis.common.util.collection.Array.remove ( Object  element  ) 

Removes the element in this ArrayList.

To find the element, array element is compared with equals method until found.

Parameters:
element to removed.
Returns:
the element that was removed from the ArrayList. Null if not found.

Definition at line 341 of file Array.java.

References org.openmobileis.common.util.collection.Array.elementData.


Member Data Documentation

Object org.openmobileis.common.util.collection.Array.elementData[] [protected]

The array buffer into which the elements of the ArrayList are stored.

The capacity of the ArrayList is the length of this array buffer.

Definition at line 47 of file Array.java.

Referenced by org.openmobileis.common.util.collection.Array.add(), org.openmobileis.common.util.collection.Array.addArray(), org.openmobileis.common.util.collection.Array.contains(), org.openmobileis.common.util.collection.Array.ensureCapacity(), org.openmobileis.common.util.collection.Array.get(), org.openmobileis.common.util.collection.Array.getLastAdded(), org.openmobileis.common.util.collection.Array.indexOf(), org.openmobileis.common.util.collection.Array.remove(), org.openmobileis.common.util.collection.Array.replace(), and org.openmobileis.common.util.collection.Array.toArray().


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:20 2010 for OpenMobileIS by  doxygen 1.5.4