Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.common
Class Collection

    java.lang.Object

      |

      +--oracle.ifs.common.Collection

public class Collection
extends java.lang.Object

A Collection is a set of Java objects.

iFS uses Collections to provide an easy-to-use API to access various sets of LibraryObjects. LibrarySession provides several methods, `getcollectionCollection`, to access the Collections it maintains.

A document management application can also create its own Collections. The `Collection(Selector, String)` constructor uses a Selector to determine the Collection's contents, and can contain only LibraryObjects (and subclasses). The `Collection(CollectionResolver)` constructor uses a callback to determine the items in a Collection, and can contain objects of any Java class.

A Collection caches its contents. Call `reset` to reset this cache, forcing the Collection to redetermine its contents using either the Selector or the CollectionResolver specified at construction.

To cause a Collection created by a document management application to be automatically `reset` in response to IfsEvents, invoke `LibrarySession.registerCollection`. The Collections provided by the LibrarySession `getcollectionCollection` methods do this automatically; you should not neither register them nor reset them.

Method Summary
`int` | `getItemCount()` Gets the number of items in this Collection.
`java.lang.Object[]` | `getItems()` Gets an array containing the items in this Collection.
`java.lang.Object` | `getItems(int index)` Gets the specified item in this Collection.
`java.lang.Object` | `getItems(java.lang.String name)` Gets the specified item in this Collection.
`java.util.Vector` | `getItemsVector()` Gets a vector containing the items in this Collection.

Method Detail

### getItemCount

    public final int getItemCount()
                           throws IfsException

  Gets the number of items in this Collection.
  Returns:
    the number of items in this Collection
  Throws:
    `IfsException` - if the operation fails

### getItems

    public java.lang.Object[] getItems()
                                throws IfsException

  Gets an array containing the items in this Collection.
  Returns:
    the items in this Collection; this can be blindly cast to an array of the class specified in the Collection constructor
  Throws:
    `IfsException` - if the operation fails

### getItems

    public java.lang.Object getItems(int index)
                              throws IfsException

  Gets the specified item in this Collection.
  Parameters:
    `index` - the zero-based index of the item
  Returns:
    the item; this can be blindly cast to the class specified in the Collection constructor
  Throws:
    `IfsException` - if the operation fails

### getItems

    public java.lang.Object getItems(java.lang.String name)
                              throws IfsException

  Gets the specified item in this Collection.
  Parameters:
    `name` - the name of the item
  Returns:
    the item; this can be blindly cast to the class specified in the Collection constructor
  Throws:
    `IfsException` - (IFS-19001) if name is null
    `IfsException` - (IFS-12200) if this Collection has no item with the specified name
    `IfsException` - if the operation otherwise fails

### getItemsVector

    public java.util.Vector getItemsVector()
                                    throws IfsException

  Gets a vector containing the items in this Collection.

  The order of the items in the vector is identical to the order of the items in the array returned by `getItems`.

  Returns:
    a vector containing the items in this Collection; each element can be blindly cast to the class specified in the Collection constructor
  Throws:
    `IfsException` - if the operation fails

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD