有没有办法将功能可见性修改器更改为私有(将其隐藏)在Kotlin中的派生类中?
例如,我正在制作自定义适配器unitSadapter
android应用程序中的类,并从listAdapter
摘要类中继承它,该类具有submits submitslist 的公共函数。
我已经制作了自己的功能
private var unfilteredList = listOf<*Something*>()
fun modifyList(list: List<BattleUnit>) {
unfilteredList = list
submitList(list)
}
,我想在此类外部仅使用modifyList
,而submistList
仅在其中可用。是否有可能以某种方式隐藏submitlist
函数?
For instance, I'm making a custom adapter UnitsAdapter
class in Android app and inheriting it from ListAdapter
abstract class that has a public function of submitList
.
I've made my own function
private var unfilteredList = listOf<*Something*>()
fun modifyList(list: List<BattleUnit>) {
unfilteredList = list
submitList(list)
}
and I want to allow use only modifyList
outside of this class while make submitList
usable only inside of it. Is it possible to somehow hide submitList
function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论