我想使用 scala 将特征传递给抽象类,这就是我目前所拥有的:
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