I am making an r-tree and I have some problem to convert from java to scala this line of code
private RTree<T>.Node chooseLeaf(RTree<T>.Node n, RTree<T>.Entry e)
Whatever I try it ends up in error. Any suggestion to solve my problem will be welcome.
Asked
Active
Viewed 94 times
-4

nik
- 1
- 1
-
3What is the error? – SwiftMango Nov 26 '18 at 15:09
-
3We're going to need to see some more code. What do you have so far? What else have you tried? What errors are you getting ? – jwismar Nov 26 '18 at 15:09
-
2Hi @nik, welcome to **StackOverflow**, it is great that you have already tried to solve it!, If you could paste the code that you have tried, and a exact description of why it isn't working or a clear question of what you don't understand, it would be more easy to help you. – Luis Miguel Mejía Suárez Nov 26 '18 at 15:10
-
Can you show us your scala code that is erroring? – Ethan Nov 26 '18 at 21:31
1 Answers
1
A direct translation would be:
def chooseLeaf[T](RTree[T].Node n, RTree[T].Entry e): RTree[T].Node = {
// ...
}
But if this method is in RTree[T]
then it is simpler:
class RTree[T] {
case class Node(...)
case class Entry(...)
def chooseLeaf(Node n, Entry e): Node = {
// ...
}
}

Tim
- 26,753
- 2
- 16
- 29