其他动词对我来说都很有意义,但我没有太多关于"post"作为动词的背景.它是否像邮局中的帖子(这有点意义,虽然看起来像是一段时间)或者像在公告板上发帖一样(对我来说不太有意义)?有谁知道谁决定"POST"以及为什么选择它?
我有两个从抽象基类继承的case类.我想在抽象基类上定义一些方法,这些方法在继承case类上使用复制方法(因此返回子类的实例.)有没有办法使用self类型?
示例代码:
abstract class BaseClass(a: String, b: Int) {
this: case class => //not legal, but I'm looking for something similar
def doubleB(newB: Int) = this.copy(b = b * 2) //doesn't work because BaseClass has no copy
}
case class HasC(a: String, b: Int, c: Boolean) extends BaseClass(a, b) {
def doesStuffWithC(newC: Boolean) = {
...
}
}
case class HasD(a: String, b: Int, D: Double) extends BaseClass(a, b) {
def doesStuffWithD(newD: Double) = {
...
}
}
Run Code Online (Sandbox Code Playgroud)
由于这个问题,我已经想出如何得到我想要的结果: 如何使用Scala的这种类型,抽象类型等来实现Self类型? …
我已经通过自制软件安装了 neo4j 2.0.0 并启动了服务器。我可以在端口 7474 访问 webadmin 控制台,但是当我运行时,neo4j-shell -host localhost -port 7474我得到:
non-JRMP server at remote endpoint
java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:341)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:101)
at org.neo4j.shell.impl.RmiLocation.getBoundObject(RmiLocation.java:253)
at org.neo4j.shell.impl.RemoteClient.findRemoteServer(RemoteClient.java:62)
at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:55)
at org.neo4j.shell.impl.RemoteClient.<init>(RemoteClient.java:43)
at org.neo4j.shell.ShellLobby.newClient(ShellLobby.java:165)
at org.neo4j.shell.StartClient.startRemote(StartClient.java:295)
at org.neo4j.shell.StartClient.start(StartClient.java:173)
at org.neo4j.shell.StartClient.main(StartClient.java:125)
Run Code Online (Sandbox Code Playgroud)
帮助?