public class CachedSelectorCollection extends CachedCollection
CachedSelectorCollection defers resolving its items until they are requested, at which point they are obtained from the underlying Selector or S_Selector and cached. Because the items are cached, CachedSelectorCollection may consume excessive Java heap for large collections.
The LIBRARYOBJECTs returned by the Selector or S_Selector must have a Name
attribute. Both getItems()
and getItemsVector()
return items sorted by Name. 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.
Modifier and Type | Field and Description |
---|---|
protected Class |
m_Class
The class of the objects in this Collection.
|
protected Selector |
m_Selector
The Selector used to obtain the items in this Collection
(if this is a collection of LibraryObjects).
|
protected S_Selector |
m_SSelector
The S_Selector used to obtain the items in this Collection
(if this is a collection of S_LibraryObjects).
|
m_ItemsArray, m_ItemsHash
Constructor and Description |
---|
CachedSelectorCollection(S_Selector selector,
String className)
Constructs a collection of S_LibraryObjects.
|
CachedSelectorCollection(Selector selector,
String className)
Constructs a collection of LibraryObjects.
|
Modifier and Type | Method and Description |
---|---|
protected void |
resolveNow()
Resolves the items in this Collection.
|
checkItemByUpperCaseName, getItemByUpperCaseName, getItemCount, getItems, getItems, getItems, getItemsVector, handleEvent, reset, resolve
protected Class m_Class
The value returned by getItems() can be cast to an array of this type.
protected S_Selector m_SSelector
protected Selector m_Selector
public CachedSelectorCollection(S_Selector selector, String className) throws IfsException
selector
- the S_Selector used to obtain the items
in the CollectionclassName
- the full classname of the objects in
this Collection; must be S_LibraryObject
or a subclass of S_LibraryObject; if null,
S_LibraryObject is usedIfsException
- (IFS-12210) if the operation failspublic CachedSelectorCollection(Selector selector, String className) throws IfsException
selector
- the Selector used to obtain the items
in the CollectionclassName
- the full classname of the objects in
this Collection; must be LibraryObject
or a subclass of LibraryObject; if null,
LibraryObject is usedIfsException
- (IFS-12210) if the operation failsprotected void resolveNow() throws IfsException
resolveNow
in class CachedCollection
IfsException
- (IFS-12201) if the operation failsCopyright © 2023. All rights reserved.