I am making an r-tree in scala and I have same errors that I can't solve them as I am new in scala. I have this code:
def search(coords: Array[Float],
dimensions: Array[Float],
n: Node,
results: LinkedList[T]): Unit = {
if (n.leaf) {
for (e <- n.children
if isOverlap(coords, dimensions, e.coords, e.dimensions)) {
results.add(e.asInstanceOf[Entry].entry)
}
} else {
for (c <- n.children
if isOverlap(coords, dimensions, c.coords, c.dimensions)) {
search(coords, dimensions, c, results)
}
}
}
And I have this class for node:
class Node (coords: Array[Float],dimensions: Array[Float],val leaf: Boolean) {
private var root: Node = _
val coords: Array[Float] = new Array[Float](coords.length)
val dimensions: Array[Float] = new Array[Float](dimensions.length)
val children: LinkedList[Node] = new LinkedList[Node]()
var parent: Node = _
System.arraycopy(coords, 0, this.coords, 0, coords.length)
System.arraycopy(dimensions, 0, this.dimensions, 0, dimensions.length)
}
And I have the error in my def search with e.coords, e.dimensions:
Description Resource Path Location Type value dimensions is not a member of RTree.Node rtee.scala /Rtree/src/rtree
Description Resource Path Location Type value dimensions is not a member of RTree.Node rtee.scala /Rtree/src/rtree
And the second third problem I have that I have trouble solving it is in LinkedList[T]:
Description Resource Path Location Type not found: type T rtee.scala /Rtree/src/rtree
Can someone give some advice in order to solve them
Comments
Post a Comment