javax.infobus
Interface ReshapeableArrayAccess


public abstract interface ReshapeableArrayAccess
extends ArrayAccess

Producers that allow a consumer to change the shape of an array, including changing the dimensions, the number of dimensions, or inserting or deleting all elements in a particular dimension implement the ReshapeableArrayAccess interface to indicate their willingness to change the shape and provide methods used for this purpose. ReshapeableArrayAccess extends ArrayAccess.

See Also:
ArrayAccess

Method Summary
 void delete(int dimension, int position, int count)
          This method is called to delete cells, columns, rows, planes, etc, in a specified dimension.
 void insert(int dimension, int position, int count)
          This method is called to insert additional cells, columns, rows, planes, etc, in a specified dimension.
 void setDimensions(int[] newDimensions)
          This method can be called to change the dimensions of an existing array.
 
Methods inherited from interface javax.infobus.ArrayAccess
getDimensions, getItemByCoordinates, setItemByCoordinates, subdivide
 

Method Detail

setDimensions

public void setDimensions(int[] newDimensions)
                   throws java.lang.IllegalArgumentException
This method can be called to change the dimensions of an existing array. Such changes involve appending or removing one or more new columns, rows, planes, etc from the end(s) of an array.

All producers that implement this interface must be able to change existing dimensions. Producers may or may not support a change to the number of dimensions; those that do not support a change in number of dimensions throw the UnsupportedOperationException for such attempts.

Parameters:
newDimensions - the number of integers indicate the requested number of dimensions in the object implementing the ArrayAccess, and the value of each integer indicates the requested number of elements in the ArrayAccess in that dimension.
Throws:
java.lang.IllegalArgumentException - if any of the specified newDimensions are not valid; dimensions not greater than 0 are invalid.
See Also:
ArrayAccess.getDimensions()

insert

public void insert(int dimension,
                   int position,
                   int count)
            throws java.lang.IllegalArgumentException
This method is called to insert additional cells, columns, rows, planes, etc, in a specified dimension.

When adding cells in a given dimension, the extents of the other dimensions are unchanged.

Parameters:
dimension - specifies which entry will be affected in the array of dimensions for this array (as returned by getDimensions()).
position - is a zero-based cell offset in the specified dimension. When position is zero up to the extent for the indicated dimension, cells are inserted before the indicated cell. When position is equal to the extent for the indicated dimension, cells are appended at the end of the array.
count - specifies the number of cells to be inserted in the specified dimension. When count is equal to the number of cells in the specified dimension, the new cells are appended at the end of the dimension.
Throws:
java.lang.IllegalArgumentException - if dimension is greater than the count of entries from the dimensions returned by getDimensions(). It must be thrown if position is less than zero or greater than the count of cells in the specified dimension. It must be thrown if count is not greater than zero. For the special case of an n-dimensional array, where n>1 and one or more of the dimensions other than the one specified by dimension has a zero extent (thus the array has no cells), it is not possible to insert new cells and this exception must be thrown.
See Also:
ArrayAccess.getDimensions()

delete

public void delete(int dimension,
                   int position,
                   int count)
            throws java.lang.IllegalArgumentException
This method is called to delete cells, columns, rows, planes, etc, in a specified dimension.
Parameters:
dimension - specifies which entry will be affected in the array of dimensions for this array (as returned by getDimensions()).
position - is a zero-based cell offset in the specified dimension. When position is zero up to the extent for the indicated dimension, deletions start at the indicated cell.
count - specifies the number of deletions in the specified dimension; it must be greater than zero, and less than the remaining cells of the indicated dimension starting with the indicated position.
Throws:
java.lang.IllegalArgumentException - if dimension is greater than the count of entries from the dimensions returned by getDimensions(). It must be thrown if position is less than zero or greater than or equal to the count of cells in the specified dimension starting with the indicated position. It is thrown if count is not greater than zero, or if position plus count is greater than the current extent in the indicated dimension.
See Also:
ArrayAccess.getDimensions()