public class ListComponentPool extends Object
ListComponent. A
ListComponentPool can be used by one or more ListComponent objects.
You can create a ListComponentPool object and use {@link ohos.agp.components.
ListComponent#setListCachedPool(ListComponentPool)} to bind it to a ListComponent.
| 限定符和类型 | 类 | 说明 |
|---|---|---|
protected static class |
ListComponentPool.ListComponentPoolCleaner |
Implements the release of the
ListComponentPool object. |
| 构造器 | 说明 |
|---|---|
ListComponentPool() |
A constructor used to create a
ListComponentPool instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
clear() |
Removes all components in this
ListComponentPool. |
ComponentOwner |
getCachedComponent(int componentType) |
Obtains components of a given type in this
ListComponentPool. |
int |
getCachedComponentCount(int componentType) |
Obtains the number of components of a given type in this
ListComponentPool. |
long |
getNativePtr() |
Obtains the native object.
|
void |
putCachedComponent(ComponentOwner componentOwner) |
Adds a component to be cached to this
ListComponentPool. |
void |
setMaxCachedSize(int componentType,
int max) |
Sets the maximum number of components of a given type that can be added to this
ListComponentPool. |
public ListComponentPool()
ListComponentPool instance.public long getNativePtr()
public void setMaxCachedSize(int componentType,
int max)
ListComponentPool.componentType - Indicates the component type.max - Indicates the maximum number to set.public void clear()
ListComponentPool.public int getCachedComponentCount(int componentType)
ListComponentPool.componentType - Indicates the component type.0 if an exception occurs.public ComponentOwner getCachedComponent(int componentType)
ListComponentPool.componentType - Indicates the component type.null if such components do not exist.public void putCachedComponent(ComponentOwner componentOwner)
ListComponentPool.componentOwner - Indicates the ComponentOwner of the component to cache.