Package

archery

Permalink

package archery

Visibility
  1. Public
  2. All

Type Members

  1. case class Box(x: Float, y: Float, x2: Float, y2: Float) extends Geom with Product with Serializable

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

    Permalink
  3. case class Entry[A](geom: Geom, value: A) extends HasGeom with Product with Serializable

    Permalink

    Represents a point with a value.

    Represents a point with a value.

    We frequently use value.== so it's important that A have a reasonable equality definition. Otherwise things like remove and contains may not work very well.

  4. sealed trait Geom extends AnyRef

    Permalink

    Geometry represents a box (or point).

    Geometry represents a box (or point).

    (x1, y1) is the lower left point and (x2, y2) is upper right.

    So Box(1, 2, 5, 4) is at (1, 2) and is 4 wide and 2 high. Points have no width or height, so x2/y2 are equal to x/y.

  5. sealed abstract class HasGeom extends AnyRef

    Permalink

    Abstract data type that has a geom element.

    Abstract data type that has a geom element.

    This generalizes Node[A] (the nodes of the tree) and Entry[A] (the values being put in the tree). It functions like a structural type (but isn't one, because structural types are slow).

  6. sealed trait Joined[A] extends Iterable[A]

    Permalink

    This is a small ADT that we use to avoid building too many intermediate vectors.

    This is a small ADT that we use to avoid building too many intermediate vectors.

    It allows us to concatenate a whole bunch of vectors or single elements cheaply, and then iterate over them later.

  7. case class Leaf[A](children: Vector[Entry[A]], box: Box) extends Node[A] with Product with Serializable

    Permalink
  8. sealed abstract class Node[A] extends HasGeom

    Permalink

    Abstract data type for nodes of the tree.

    Abstract data type for nodes of the tree.

    There are two types of Node: Branch and Leaf. Confusingly, leaves don't actaully hold values, but rather a leaf contains a sequence of entries. This design is commmon to RTree implementations and it seemed like a good idea to keep the nomenclature the same.

  9. case class Point(x: Float, y: Float) extends Geom with Product with Serializable

    Permalink
  10. case class RTree[A](root: Node[A], size: Int) extends Product with Serializable

    Permalink

    This is the magnificent RTree, which makes searching ad-hoc geographic data fast and fun.

    This is the magnificent RTree, which makes searching ad-hoc geographic data fast and fun.

    The RTree wraps a node called 'root' that is the actual root of the tree structure. RTree also keeps track of the total size of the tree (something that individual nodes don't do).

Value Members

  1. object Box extends Serializable

    Permalink
  2. object Constants

    Permalink

    Some useful constants that we don't want to hardcode.

  3. object Joined

    Permalink
  4. object Node

    Permalink
  5. object RTree extends Serializable

    Permalink

Ungrouped