com.odi.odmg
Interface List

All Superinterfaces:
java.lang.Cloneable, Collection, IPersistent
All Known Implementing Classes:
ListOfObject

public interface List
extends Collection

The List interface is a subinterface of the Collection interface. The List interface encapsulates the operations on a list.

All methods throw the following exceptions:

com.odi.odmg.TransactionNotInProgressException If there is no transaction in progress.

com.odi.ObjectStoreException If the current thread is not associated with a transaction or if the instance in question is not associated with the current thread.

Methods that modify persistent objects throw this exception:

com.odi.odmg.DatabaseIsReadOnlyException If there is a readonly transaction in progress or if the database is open for readonly.

See Also:
ListOfObject

Method Summary
 void add(int index, java.lang.Object obj)
          Equivalent to the ODMG method void insert_element_before().
 void append(List otherList)
          Equivalent to the ODMG method void append().
 List concat(List otherList)
          Equivalent to the ODMG method List concat().
 java.lang.Object get(int index)
          Equivalent to the ODMG method any retrieve_element_at().
 void put(int index, java.lang.Object obj)
          Equivalent to the ODMG method void replace-element_at().
 java.lang.Object remove(int index)
          Equivalent to the ODMG method void remove_element_at().
 
Methods inherited from interface com.odi.odmg.Collection
add, contains, elements, existsElement, isEmpty, query, remove, select, selectElement, size
 
Methods inherited from interface com.odi.IPersistent
clearContents, flushContents, initializeContents, ODIgetRef, ODIgetState, ODIsetRef, ODIsetState
 

Method Detail

add

public void add(int index,
                java.lang.Object obj)
         throws java.lang.ArrayIndexOutOfBoundsException
Equivalent to the ODMG method void insert_element_before().
Parameters:
index - The position at which to add the object.
obj - The object to be added.

Throws:
ObjectNotExportedException - If the list and the object being inserted are in different segments and the object is not exported.
ObjectNotPersistenceCapableException - If the object is not persistence-capable.
java.lang.ArrayIndexOutOfBoundsException - If the index is out of the bounds of this object.

put

public void put(int index,
                java.lang.Object obj)
         throws java.lang.ArrayIndexOutOfBoundsException
Equivalent to the ODMG method void replace-element_at().
Parameters:
index - The position at which to put the object.
obj - The object to be added.

Throws:
ObjectNotExportedException - If the list and the object being inserted are in different segments and the object is not exported.
ObjectNotPersistenceCapableException - If the object is not persistence-capable.
java.lang.ArrayIndexOutOfBoundsException - If the index is out of the bounds of this object.

remove

public java.lang.Object remove(int index)
                        throws java.lang.ArrayIndexOutOfBoundsException
Equivalent to the ODMG method void remove_element_at().
Parameters:
index - The position at which to remove the element.

Returns:
Returns the object that was successfully removed.

Throws:
java.lang.ArrayIndexOutOfBoundsException - If the index is out of the bounds of this object.

get

public java.lang.Object get(int index)
                     throws java.lang.ArrayIndexOutOfBoundsException
Equivalent to the ODMG method any retrieve_element_at().
Parameters:
index - The index of the object to be retrieved.

Returns:
Returns the object at the specified index.

Throws:
java.lang.ArrayIndexOutOfBoundsException - If the index is out of the bounds of this object.

concat

public List concat(List otherList)
Equivalent to the ODMG method List concat().
Parameters:
otherList - The list with which to form a concatenation.

Returns:
Returns the concatenation of this list and otherList.

append

public void append(List otherList)
Equivalent to the ODMG method void append().
Parameters:
otherList - The list that you want to append to this list.


Copyright 2004 Progress Software Corporation. All rights reserved.