Interface COM.odi.odmg.List

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 Index

 o add(int, Object)
Equivalent to the ODMG method void insert_element_before().
 o append(List)
Equivalent to the ODMG method void append().
 o concat(List)
Equivalent to the ODMG method List concat().
 o get(int)
Equivalent to the ODMG method any retrieve_element_at().
 o put(int, Object)
Equivalent to the ODMG method void replace-element_at().
 o remove(int)
Equivalent to the ODMG method void remove_element_at().

Methods

 o add
  public abstract void add(int index,
                           Object obj) throws 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.
Throws: ObjectNotPersistenceCapableException
If the object is not persistence-capable.
Throws: ArrayIndexOutOfBoundsException
If the index is out of the bounds of this object.
 o put
  public abstract void put(int index,
                           Object obj) throws 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.
Throws: ObjectNotPersistenceCapableException
If the object is not persistence-capable.
Throws: ArrayIndexOutOfBoundsException
If the index is out of the bounds of this object.
 o remove
  public abstract Object remove(int index) throws 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: ArrayIndexOutOfBoundsException
If the index is out of the bounds of this object.
 o get
  public abstract Object get(int index) throws 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: ArrayIndexOutOfBoundsException
If the index is out of the bounds of this object.
 o concat
  public abstract 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.
 o append
  public abstract void append(List otherList)
Equivalent to the ODMG method void append().

Parameters:
otherList - The list that you want to append to this list.

Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.