Interface COM.odi.odmg.VArray

public interface VArray
extends Collection
The VArray interface is a subinterface of the Collection interface. The VArray interface encapsulates the operations on a resizeable array.

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:
VArrayOfObject

Method Index

 o add(int, Object)
Equivalent to the ODMG method void insert_element_before().
 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().
 o resize(int)
Equivalent to the ODMG method Array concat().

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 add to the array.

Throws: ObjectNotExportedException
If the array and the object being inserted are in different segments and the object is not exported.
Throws: ObjectNotPersistenceCapableException
If the object is not persistence-capable.
 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 put in the array.

Throws: ObjectNotExportedException
If the array 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 index of the object to be removed.

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 position of the object to retrieve.

Returns:
Returns the object at the specified position.
Throws: ArrayIndexOutOfBoundsException
If the index is out of the bounds of this object.
 o resize
  public abstract void resize(int newSize)
Equivalent to the ODMG method Array concat().

Parameters:
newSize - The new size of the array after the resize.

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