Class

archery

Branch

Related Doc: package archery

Permalink

case class Branch[A](children: Vector[Node[A]], box: Box) extends Node[A] with Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, Node[A], HasGeom, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Branch
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Node
  7. HasGeom
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Branch(children: Vector[Node[A]], box: Box)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val box: Box

    Permalink
    Definition Classes
    BranchNode
  6. val children: Vector[Node[A]]

    Permalink
    Definition Classes
    BranchNode
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def contains(entry: Entry[A]): Boolean

    Permalink

    Determine if entry is contained in the tree.

    Determine if entry is contained in the tree.

    This method depends upon reasonable equality for A. It can only match an Entry(pt, x) if entry.value == x.value.

    Definition Classes
    Node
  9. def contract(gone: Geom, regen: ⇒ Box): Box

    Permalink

    Determine if we need to try contracting our bounding box based on the loss of 'geom'.

    Determine if we need to try contracting our bounding box based on the loss of 'geom'. If so, use the by-name parameter 'regen' to recalculate. Since regen is by-name, it won't be evaluated unless we need it.

    Definition Classes
    Node
  10. def count(space: Box): Int

    Permalink

    Count the number of entries contained within space.

    Count the number of entries contained within space.

    Definition Classes
    Node
  11. def entries: Vector[Entry[A]]

    Permalink

    Put all the entries this node contains (directly or indirectly) into a vector.

    Put all the entries this node contains (directly or indirectly) into a vector. Obviously this could be quite large in the case of a root node, so it should not be used for traversals.

    Definition Classes
    Node
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def foldSearch[B](space: Box, init: B)(f: (B, Entry[A]) ⇒ B): B

    Permalink

    Combine the results of a search(space) into a single result.

    Combine the results of a search(space) into a single result.

    Definition Classes
    Node
  15. def genericSearch(geom: Geom, check: (Geom) ⇒ Boolean, f: (Entry[A]) ⇒ Boolean): Seq[Entry[A]]

    Permalink

    Search for all entries given a search space, spatial checking function, and criteria function.

    Search for all entries given a search space, spatial checking function, and criteria function.

    This method abstracts search and searchIntersection, where the check function is either space.contains or space.intersects, respectively.

    Definition Classes
    Node
  16. def geom: Geom

    Permalink
    Definition Classes
    NodeHasGeom
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def insert(entry: Entry[A]): Either[Vector[Node[A]], Node[A]]

    Permalink

    Insert a new Entry into the tree.

    Insert a new Entry into the tree.

    Since this node is immutable, the method will return a replacement. There are two possible situations:

    1. We can replace this node with a new node. This is the common case.

    2. This node was already "full", so we can't just replace it with a single node. Instead, we will split this node into (presumably) two new nodes, and return a vector of them.

    The reason we are using vector here is that it simplifies the implementation, and also because eventually we may support bulk insertion, where more than two nodes might be returned.

    Definition Classes
    Node
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def iterator: Iterator[Entry[A]]

    Permalink

    Returns an iterator over all the entires this node contains (directly or indirectly).

    Returns an iterator over all the entires this node contains (directly or indirectly). Since nodes are immutable there is no concern over concurrent updates while using the iterator.

    Definition Classes
    Node
  21. def map[B](f: (A) ⇒ B): Node[B]

    Permalink

    Transform each entry's value using the given f, returning a new node.

    Transform each entry's value using the given f, returning a new node.

    Definition Classes
    Node
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. def nearest(pt: Point, d0: Double): Option[(Double, Entry[A])]

    Permalink

    Find the closest entry to pt that is within d0.

    Find the closest entry to pt that is within d0.

    This method will either return Some((distance, entry)) or None.

    Definition Classes
    Node
  24. def nearestK(pt: Point, k: Int, d0: Double, pq: PriorityQueue[(Double, Entry[A])]): Double

    Permalink

    Find the closest k entries to pt that are within d0, and add them to the given priority queue pq.

    Find the closest k entries to pt that are within d0, and add them to the given priority queue pq.

    This method returns the distance of the farthest entry that is still included.

    Definition Classes
    Node
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. def pretty: String

    Permalink

    Method to pretty-print an r-tree.

    Method to pretty-print an r-tree.

    This method should only be called on small-ish trees! It will print one line for every branch, leaf, and entry, so for a tree with thousands of entries this will result in a very large string!

    Definition Classes
    Node
  28. def remove(entry: Entry[A]): Option[(Joined[Entry[A]], Option[Node[A]])]

    Permalink

    Remove this entry from the tree.

    Remove this entry from the tree.

    The implementations for Leaf and Branch are somewhat involved, so they are defined in each subclass.

    The return value can be understood as follows:

    1. None: the entry was not found in this node. This is the most common case.

    2. Some((es, None)): the entry was found, and this node was removed (meaning after removal it had too few other children). The 'es' vector are entries that need to be readded to the RTree.

    3. Some((es, Some(node))): the entry was found, and this node should be replaced by 'node'. Like above, the 'es' vector contains entries that should be readded.

    Because adding entries may require rebalancing the tree, we defer the insertions until after the removal is complete and then readd them in RTree. While 'es' will usually be quite small, it's possible that in some cases it may be very large.

    Definition Classes
    BranchNode
  29. def search(space: Box, f: (Entry[A]) ⇒ Boolean): Seq[Entry[A]]

    Permalink

    Search for all entries contained in the search space.

    Search for all entries contained in the search space.

    Points on the boundary of the search space will be included.

    Definition Classes
    Node
  30. def searchIntersection(geom: Geom, f: (Entry[A]) ⇒ Boolean): Seq[Entry[A]]

    Permalink

    Search for all entries intersecting the search space.

    Search for all entries intersecting the search space.

    Points on the boundary of the search space will be included.

    Definition Classes
    Node
  31. def searchIterator(space: Box, f: (Entry[A]) ⇒ Boolean): Iterator[Entry[A]]

    Permalink

    Return an iterator over the results of a search.

    Return an iterator over the results of a search.

    This produces the same elements as search(space, f).iterator(), without having to build an entire vector at once.

    Definition Classes
    Node
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Node[A]

Inherited from HasGeom

Inherited from AnyRef

Inherited from Any

Ungrouped