我坚持以下代码:
trait Service extends Closeable {
class STATE(value: Int, statename: String) extends Eumeration(value: Int, statename: String) {
val NOTINITED = Value(0, "NOTINITED")
val INITED = Value(1, "INITED")
val STARTED = Value(2, "STARTED")
val STOPPED = Value(3, "STOPPED")
override def toString() = statename
type STATE = Value
}
}
然后我创建了一个新类
import abc.event.Service
class ServiceStateModel(name: String) {
val statemap: Array[Array[Boolean]] = Array(
Array(false, true, false, true),
Array(false, true, true, true),
Array(false, false, true, true),
Array(false, false, false, true))
}
在上面的代码编译器给了我一个警告
**Multiple markers at this line
- imported `Service' is permanently hidden by definition of trait Service in package event
- imported `Service' is permanently hidden by definition of trait Service in package event**
结果,我通过以下导入将其重命名Service
为:SS
import abc.event.{Service => SS}
但现在SS
连认不出来
PS 我的类路径中有 hadoop 库,它有一个名为 的接口Service
,因此我导入了自己的Service
特征。