public abstract class CachedCollection extends Object implements Collection
CachedCollection defers resolving its items until they are requested. Because the items are cached, CachedCollection may consume excessive Java heap for large collections.
Modifier and Type | Field and Description |
---|---|
protected Object[] |
m_ItemsArray
The items in this Collection, as an array.
|
protected Hashtable |
m_ItemsHash
A hashtable whose key is the item name, and
whose value is the item in this Collection.
|
Constructor and Description |
---|
CachedCollection()
Constructs a CachedCollection.
|
Modifier and Type | Method and Description |
---|---|
Object |
checkItemByUpperCaseName(String name)
Gets the specified item in this Collection by uppercase name,
and returns null if not found.
|
Object |
getItemByUpperCaseName(String upperCaseName)
Gets the specified item in this Collection by uppercase name.
|
int |
getItemCount()
Gets the number of items in this Collection.
|
Object[] |
getItems()
Gets an array containing the items in this Collection.
|
Object |
getItems(int index)
Gets the specified item in this Collection.
|
Object |
getItems(String name)
Gets the specified item in this Collection.
|
Vector |
getItemsVector()
Gets a vector containing the items in this Collection.
|
void |
handleEvent(IfsEvent event)
Handles the specified event.
|
void |
reset()
Resets this Collection.
|
protected void |
resolve()
Ensures the items in this Collection are resolved.
|
protected void |
resolveNow()
Resolves the items in this Collection.
|
protected Object[] m_ItemsArray
protected Hashtable m_ItemsHash
public CachedCollection() throws IfsException
IfsException
- (IFS-12210) if the operation failspublic final int getItemCount() throws IfsException
getItemCount
in interface Collection
IfsException
- (IFS-12211) if the operation failspublic Object[] getItems() throws IfsException
getItems
in interface Collection
IfsException
- (IFS-12212) if the operation failspublic Object getItems(int index) throws IfsException
getItems
in interface Collection
index
- the zero-based index of the itemIfsException
- (IFS-12213) if the operation failspublic Object getItems(String name) throws IfsException
getItems
in interface Collection
name
- the name of the itemIfsException
- (IFS-12214) if the operation failspublic Object getItemByUpperCaseName(String upperCaseName) throws IfsException
getItemByUpperCaseName
in interface Collection
upperCaseName
- the name of the itemIfsException
- (IFS-12214) if the operation failspublic Object checkItemByUpperCaseName(String name) throws IfsException
checkItemByUpperCaseName
in interface Collection
name
- the name of the itemIfsException
- (IFS-12214) if the operation failspublic Vector getItemsVector() throws IfsException
The order of the items in the vector is identical to the order of the
items in the array returned by getItems()
.
getItemsVector
in interface Collection
IfsException
- (IFS-12215) if the operation failspublic void reset() throws IfsException
Resetting a Collection causes the items in it to be redetermined.
reset
in interface Collection
IfsException
- (IFS-12216) if the operation failsprotected final void resolve() throws IfsException
IfsException
- (IFS-12201) if the operation failsprotected void resolveNow() throws IfsException
IfsException
- (IFS-12201) if the operation failspublic void handleEvent(IfsEvent event) throws IfsException
handleEvent
in interface IfsEventHandler
event
- the eventIfsException
- if the operation failsCopyright © 2023. All rights reserved.