Oracle Content Management SDK

oracle.ifs.common
Class UncachedSelectorCollection

java.lang.Object
  |
  +--oracle.ifs.common.UncachedSelectorCollection
All Implemented Interfaces:
Collection, IfsEventHandler

public class UncachedSelectorCollection
extends java.lang.Object
implements Collection

An UncachedSelectorCollection is a Collection whose items are LIBRARYOBJECTs specified by a Selector or S_Selector and not cached by the collection.

By not caching its items, an UncachedSelectorCollection maintains a small memory footprint. However, each use of the collection causes a database roundtrip, making UncachedSelectorCollection less performant than CachedSelectorCollection.

The order of items returned by getItems() and getItemsVector() is determined by the sort specification of the Selector or S_Selector. The method getItems(int) is implemented in terms of getItems(). For best performance in iterating over the items of the collection, call getItems() once instead of getItems(int) repeatedly.

The LIBRARYOBJECTs returned by the Selector or S_Selector must have a Name attribute. Use getItems(String) to look up an item by name. This lookup is case-insentive. If more than one item has the same case-insensitive name, getItems(String) returns an arbitrary item with that name.

The performance of getItems(String) can be improved by enabling a mini-cache of the "n" items most-recently returned by this method. The size of this mini-cache is specified by a constructor argument.


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.
 void handleEvent(IfsEvent event)
          Handles the specified event.
 

Method Detail


getItemCount

public int getItemCount()
                 throws IfsException
Gets the number of items in this Collection.
Specified by:
getItemCount in interface Collection
Returns:
the number of items in this Collection
Throws:
IfsException - (IFS-12211) if the operation fails

getItems

public java.lang.Object[] getItems()
                            throws IfsException
Gets an array containing the items in this Collection.
Specified by:
getItems in interface Collection
Returns:
the items in this Collection
Throws:
IfsException - (IFS-12212) if the operation fails

getItems

public java.lang.Object getItems(int index)
                          throws IfsException
Gets the specified item in this Collection.
Specified by:
getItems in interface Collection
Parameters:
index - the zero-based index of the item
Returns:
the item
Throws:
IfsException - (IFS-12213) if the operation fails

getItems

public java.lang.Object getItems(java.lang.String name)
                          throws IfsException
Gets the specified item in this Collection.
Specified by:
getItems in interface Collection
Parameters:
name - the name of the item
Returns:
the item
Throws:
IfsException - (IFS-12214) if the operation 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().

Specified by:
getItemsVector in interface Collection
Returns:
a vector containing the items in this Collection
Throws:
IfsException - (IFS-12215) if the operation fails

handleEvent

public void handleEvent(IfsEvent event)
                 throws IfsException
Handles the specified event. This results in the Collection being reset.
Specified by:
handleEvent in interface IfsEventHandler
Parameters:
event - the event
Throws:
IfsException - if the operation fails

Oracle Content Management SDK

(c) 2002 Copyright Oracle Corporation. All rights reserved.