我想傳遞一個特點,使用Scala的抽象類,這是我到目前爲止有:斯卡拉通性狀abtract類
trait User extends VertexFrame {}
trait Member extends VertexFrame {}
object Member extends Base[Member] {}
object User extends Base[User] {}
abstract class Base[T <: VertexFrame: Manifest] {
// Here if want to be able to access my "trait User" or my "trait Member"
def list = {
graph.frameVertices(graph.getVertices, manifest[T].runtimeClass).toList
}
}
圖:http://www.tinkerpop.com/docs/javadocs/frames/2.0.0/com/tinkerpop/frames/FramedGraph.html
你的問題有點混亂。基於'T'的類型提供的'Base',你想要做什麼?你想做什麼,你還沒有做到,因此請求幫助? – cmbaxter
@cmbaxter在我的抽象類中,我希望我的測試方法返回classOf傳遞給Base(Member或User)的特徵 – Roch