Scala中的进口

时间:2013-09-17 10:22:56

标签: scala

我坚持使用以下代码:

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甚至无法识别

P.S我在我的类路径中有hadoop libs,它有一个名为Service的接口,因此我导入了我自己的Service特征。

0 个答案:

没有答案