简体   繁体   English

如何在Android中创建扩展SparseArray的类?

[英]How to create a class which extends the SparseArray in Android?

I want to create a class and it extends the SparseArray . 我想创建一个类,它扩展了SparseArray The mKeys and mValues are private in SparseArray , so it cannot be accessed in my Class. mKeysmValues在SparseArray中是私有的,因此无法在我的Class中访问。 But I need do some special things about the mKeys and mValues. 但是我需要对mKeys和mValues做一些特殊的事情。 How to handle it ? 怎么处理呢?

http://developer.android.com/reference/android/util/SparseArray.html http://developer.android.com/reference/android/util/SparseArray.html

好吧,如果mkey和mvalue是私有的,并且没有geter和seter,我认为没有一种方法可以正常地访问它们,而不会破坏代码,因为coz private修饰符旨在不允许开发人员访问它们

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从不扩展Activity,Android的类中创建DatePicker? - How to create a DatePicker from class which do not extends Activity, Android? 如何从不扩展 Activity、Android 的类创建 TimePicker? - How to create a TimePicker from class which do not extends Activity, Android? 如何在扩展JPanel的类中创建bufferstrategy - How to create bufferstrategy in a class which extends JPanel 有什么方法可以创建从Android中的Canvas扩展的类吗? - Is there any way to create class which extends from Canvas in Android? Android Java-创建扩展现有类的接口 - Android Java - create an interface which extends an existing class 如何为扩展异常类的BusinessException创建存根 - How to create a stub for BusinessException which extends Exception class 如何创建具有类型参数的泛型类的实例,该类在其自己的类中扩展了静态类? - How to create an instance of a generic class that has a type paramater which extends a static class within its own class? 如何在SparseArray容器中使用扩展类? - How to use extended class in SparseArray container? Java:如何创建一个泛型类,它需要一个扩展类并实现接口的数据类型? - Java: how to create a generic class that requires a data type which extends a class and implements an interface? 我如何创建通用类Enum <K> 扩展EnumMap并调用super(K.class)? - How may I create an Generic class Enum<K> which extends EnumMap and call super( K.class )?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM