public class SparseArrayObjectAdapter
extends ObjectAdapter
| java.lang.Object | ||
| android.support.v17.leanback.widget.ObjectAdapter | ||
| android.support.v17.leanback.widget.SparseArrayObjectAdapter | ||
用ObjectAdapter实现SparseArray 。 该类维护一个对象数组,其中每个对象都与一个整数键相关联,该整数键确定其相对于其他对象的顺序。
Inherited constants |
|---|
android.support.v17.leanback.widget.ObjectAdapter
|
Public constructors |
|
|---|---|
SparseArrayObjectAdapter(PresenterSelector presenterSelector) 用给定的 |
|
SparseArrayObjectAdapter(Presenter presenter) 用给定的 |
|
SparseArrayObjectAdapter() 构造一个适配器。 |
|
公共方法(Public methods) |
|
|---|---|
void |
clear(int key) 清除适配器中的给定密钥和相关项目。 |
void |
clear() 删除此适配器中的所有项目,并保留为空。 |
Object |
get(int position) 返回给定位置的项目。 |
int |
indexOf(Object item) 返回适配器中给定项目的索引。 |
int |
indexOf(int key) 返回适配器中给定键的索引。 |
Object |
lookup(int key) 返回给定键的对象,如果不存在该键的映射,则返回null。 |
void |
notifyArrayItemRangeChanged(int positionStart, int itemCount) 通知一系列项目的内容已更改。 |
void |
set(int key, Object item) 设置给定键的项目。 |
int |
size() 返回适配器中的项目数量。 |
继承方法(Inherited methods) |
|
|---|---|
android.support.v17.leanback.widget.ObjectAdapter
|
|
java.lang.Object
|
|
SparseArrayObjectAdapter (PresenterSelector presenterSelector)
用给定的 PresenterSelector构造一个适配器。
| 参数(Parameters) | |
|---|---|
presenterSelector |
PresenterSelector
|
SparseArrayObjectAdapter (Presenter presenter)
用给定的 Presenter构造一个适配器。
| 参数(Parameters) | |
|---|---|
presenter |
Presenter
|
SparseArrayObjectAdapter ()
构造一个适配器。
void clear (int key)
清除适配器中的给定密钥和相关项目。
| 参数(Parameters) | |
|---|---|
key |
int: The key to be cleared. |
void clear ()
删除此适配器中的所有项目,并保留为空。
int indexOf (Object item)
返回适配器中给定项目的索引。
| 参数(Parameters) | |
|---|---|
item |
Object: The item to find in the array. |
| 返回(Returns) | |
|---|---|
int |
Index of the item, or a negative value if not found. |
int indexOf (int key)
返回适配器中给定键的索引。
| 参数(Parameters) | |
|---|---|
key |
int: The key to find in the array. |
| 返回(Returns) | |
|---|---|
int |
Index of the item, or a negative value if not found. |
Object lookup (int key)
返回给定键的对象,如果不存在该键的映射,则返回null。
| 参数(Parameters) | |
|---|---|
key |
int
|
| 返回(Returns) | |
|---|---|
Object |
|
void notifyArrayItemRangeChanged (int positionStart,
int itemCount)
通知一系列项目的内容已更改。 请注意,这与正在添加或删除的项目不同。
| 参数(Parameters) | |
|---|---|
positionStart |
int: The position of first item that has changed. |
itemCount |
int: The count of how many items have changed. |
void set (int key,
Object item)
设置给定键的项目。
| 参数(Parameters) | |
|---|---|
key |
int: The key associated with the item. |
item |
Object: The item associated with the key. |
int size ()
返回适配器中的项目数量。
| 返回(Returns) | |
|---|---|
int |
|