编程语言
939
seal class
在kotlin1.1前,sealclass只能在类内部定义,在kotlin1.1后,可以定义在同一个文件中
sealed class PlayerCmd { class Play(val url: String, val position: Long = 0): PlayerCmd() class Seek(val position: Long): PlayerCmd() object Pause: PlayerCmd() object Resume: PlayerCmd() object Stop: PlayerCmd() } enum class PlayerState{ IDLE, PAUSE, PLAYING }