test_class.declarator: log = LoggerFactory.getLogger(SpatialQuadTreeTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(SpatialQuadTreeTest.class);
test_class.type: Logger
test_class.var_name: log
test_class.declarator: width = 600
test_class.original_string: int width = 600;
test_class.type: int
test_class.var_name: width
test_class.declarator: height = 600
test_class.original_string: int height = 600;
test_class.type: int
test_class.var_name: height
test_class.declarator: graph
test_class.original_string: Graph<String> graph;
test_class.type: Graph<String>
test_class.var_name: graph
test_class.declarator: layoutModel
test_class.original_string: LayoutModel<String> layoutModel;
test_class.type: LayoutModel<String>
test_class.var_name: layoutModel
test_class.declarator: tree
test_class.original_string: SpatialQuadTree<String> tree;
test_class.type: SpatialQuadTree<String>
test_class.var_name: tree
test_class.file: jung-visualization/src/test/java/edu/uci/ics/jung/visualization/spatial/SpatialQuadTreeTest.java
test_class.identifier: SpatialQuadTreeTest
test_case.body: @Test
    public void comparePerformance() {
      final int COUNT = 100000;
      NetworkNodeAccessor<String> slowWay = new RadiusNetworkNodeAccessor<>(Double.MAX_VALUE);
  
      // generate the points first so both tests use the same points
      double[] xs = new double[COUNT];
      double[] ys = new double[COUNT];
      for (int i = 0; i < COUNT; i++) {
        xs[i] = Math.random() * layoutModel.getWidth();
        ys[i] = Math.random() * layoutModel.getHeight();
      }
      long start = System.currentTimeMillis();
      // look for nodes closest to 10000 random locations
      for (int i = 0; i < COUNT; i++) {
        // use the RadiusNetworkNodeAccessor
        String winnerOne = slowWay.getNode(layoutModel, xs[i], ys[i]);
      }
      long end = System.currentTimeMillis();
      log.info("radius way took {}", end - start);
      start = System.currentTimeMillis();
      for (int i = 0; i < COUNT; i++) {
        // use the quadtree
        String winnerTwo = tree.getClosestElement(xs[i], ys[i]);
      }
      end = System.currentTimeMillis();
      log.info("spatial way took {}", end - start);
    }
test_case.class_method_signature: SpatialQuadTreeTest.comparePerformance()
test_case.full_signature: @Test public void comparePerformance()
test_case.identifier: comparePerformance
test_case.invocations: random getWidth random getHeight currentTimeMillis getNode currentTimeMillis info currentTimeMillis getClosestElement currentTimeMillis info
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void comparePerformance()
focal_class.declarator: log = LoggerFactory.getLogger(SpatialQuadTree.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(SpatialQuadTree.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: lock = new Object()
focal_class.modifier: private final
focal_class.original_string: private final Object lock = new Object();
focal_class.type: Object
focal_class.var_name: lock
focal_class.declarator: MAX_OBJECTS = 1
focal_class.modifier: private
focal_class.original_string: private int MAX_OBJECTS = 1;
focal_class.type: int
focal_class.var_name: MAX_OBJECTS
focal_class.declarator: MAX_LEVELS = 12
focal_class.modifier: private
focal_class.original_string: private int MAX_LEVELS = 12;
focal_class.type: int
focal_class.var_name: MAX_LEVELS
focal_class.declarator: level
focal_class.modifier: private
focal_class.original_string: private int level;
focal_class.type: int
focal_class.var_name: level
focal_class.declarator: nodes
focal_class.modifier: private
focal_class.original_string: private Set<N> nodes;
focal_class.type: Set<N>
focal_class.var_name: nodes
focal_class.declarator: area
focal_class.modifier: private
focal_class.original_string: private Rectangle2D area;
focal_class.type: Rectangle2D
focal_class.var_name: area
focal_class.declarator: children
focal_class.modifier: private
focal_class.original_string: private Map<Quadrant, SpatialQuadTree<N>> children;
focal_class.type: Map<Quadrant, SpatialQuadTree<N>>
focal_class.var_name: children
focal_class.declarator: gridCache
focal_class.modifier: private
focal_class.original_string: private List<Spatial> gridCache;
focal_class.type: List<Spatial>
focal_class.var_name: gridCache
focal_class.file: jung-visualization/src/main/java/edu/uci/ics/jung/visualization/spatial/SpatialQuadTree.java
focal_class.identifier: SpatialQuadTree
focal_class.interfaces: implements TreeNode, Spatial<N>, LayoutChangeListener<N>
focal_class.class_method_signature: SpatialQuadTree.getBounds()
focal_class.full_signature: @Override public Rectangle2D getBounds()
focal_class.identifier: getBounds
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Rectangle2D
focal_class.signature: Rectangle2D getBounds()
focal_class.class_method_signature: SpatialQuadTree.getChildren()
focal_class.full_signature: @Override public Collection<? extends TreeNode> getChildren()
focal_class.identifier: getChildren
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<? extends TreeNode>
focal_class.signature: Collection<? extends TreeNode> getChildren()
focal_class.class_method_signature: SpatialQuadTree.SpatialQuadTree(LayoutModel<N> layoutModel)
focal_class.full_signature: public  SpatialQuadTree(LayoutModel<N> layoutModel)
focal_class.identifier: SpatialQuadTree
focal_class.modifiers: public
focal_class.parameters: (LayoutModel<N> layoutModel)
focal_class.signature:  SpatialQuadTree(LayoutModel<N> layoutModel)
focal_class.class_method_signature: SpatialQuadTree.SpatialQuadTree(LayoutModel<N> layoutModel, double width, double height)
focal_class.full_signature: public  SpatialQuadTree(LayoutModel<N> layoutModel, double width, double height)
focal_class.identifier: SpatialQuadTree
focal_class.modifiers: public
focal_class.parameters: (LayoutModel<N> layoutModel, double width, double height)
focal_class.signature:  SpatialQuadTree(LayoutModel<N> layoutModel, double width, double height)
focal_class.class_method_signature: SpatialQuadTree.SpatialQuadTree(
        LayoutModel<N> layoutModel, int level, double x, double y, double width, double height)
focal_class.full_signature: public  SpatialQuadTree(
        LayoutModel<N> layoutModel, int level, double x, double y, double width, double height)
focal_class.identifier: SpatialQuadTree
focal_class.modifiers: public
focal_class.parameters: (
        LayoutModel<N> layoutModel, int level, double x, double y, double width, double height)
focal_class.signature:  SpatialQuadTree(
        LayoutModel<N> layoutModel, int level, double x, double y, double width, double height)
focal_class.class_method_signature: SpatialQuadTree.SpatialQuadTree(LayoutModel<N> layoutModel, int pLevel, Rectangle2D area)
focal_class.full_signature: public  SpatialQuadTree(LayoutModel<N> layoutModel, int pLevel, Rectangle2D area)
focal_class.identifier: SpatialQuadTree
focal_class.modifiers: public
focal_class.parameters: (LayoutModel<N> layoutModel, int pLevel, Rectangle2D area)
focal_class.signature:  SpatialQuadTree(LayoutModel<N> layoutModel, int pLevel, Rectangle2D area)
focal_class.class_method_signature: SpatialQuadTree.setMaxObjects(int o)
focal_class.full_signature: public SpatialQuadTree<N> setMaxObjects(int o)
focal_class.identifier: setMaxObjects
focal_class.modifiers: public
focal_class.parameters: (int o)
focal_class.return: SpatialQuadTree<N>
focal_class.signature: SpatialQuadTree<N> setMaxObjects(int o)
focal_class.class_method_signature: SpatialQuadTree.setMaxLevels(int l)
focal_class.full_signature: public SpatialQuadTree<N> setMaxLevels(int l)
focal_class.identifier: setMaxLevels
focal_class.modifiers: public
focal_class.parameters: (int l)
focal_class.return: SpatialQuadTree<N>
focal_class.signature: SpatialQuadTree<N> setMaxLevels(int l)
focal_class.class_method_signature: SpatialQuadTree.getLevel()
focal_class.full_signature: protected int getLevel()
focal_class.identifier: getLevel
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getLevel()
focal_class.class_method_signature: SpatialQuadTree.getNodes()
focal_class.full_signature: public Set<N> getNodes()
focal_class.identifier: getNodes
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<N>
focal_class.signature: Set<N> getNodes()
focal_class.class_method_signature: SpatialQuadTree.clear()
focal_class.full_signature: @Override public void clear()
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: SpatialQuadTree.split()
focal_class.full_signature: protected void split()
focal_class.identifier: split
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void split()
focal_class.class_method_signature: SpatialQuadTree.getQuadrant(Point p)
focal_class.full_signature: protected Quadrant getQuadrant(Point p)
focal_class.identifier: getQuadrant
focal_class.modifiers: protected
focal_class.parameters: (Point p)
focal_class.return: Quadrant
focal_class.signature: Quadrant getQuadrant(Point p)
focal_class.class_method_signature: SpatialQuadTree.getQuadrant(double x, double y)
focal_class.full_signature: protected Quadrant getQuadrant(double x, double y)
focal_class.identifier: getQuadrant
focal_class.modifiers: protected
focal_class.parameters: (double x, double y)
focal_class.return: Quadrant
focal_class.signature: Quadrant getQuadrant(double x, double y)
focal_class.class_method_signature: SpatialQuadTree.insert(N p)
focal_class.full_signature: protected void insert(N p)
focal_class.identifier: insert
focal_class.modifiers: protected
focal_class.parameters: (N p)
focal_class.return: void
focal_class.signature: void insert(N p)
focal_class.class_method_signature: SpatialQuadTree.retrieve(Set<N> returnObjects, Rectangle2D r)
focal_class.full_signature: protected Set<N> retrieve(Set<N> returnObjects, Rectangle2D r)
focal_class.identifier: retrieve
focal_class.modifiers: protected
focal_class.parameters: (Set<N> returnObjects, Rectangle2D r)
focal_class.return: Set<N>
focal_class.signature: Set<N> retrieve(Set<N> returnObjects, Rectangle2D r)
focal_class.class_method_signature: SpatialQuadTree.retrieve(Set<N> returnObjects, Shape shape)
focal_class.full_signature: protected Set<N> retrieve(Set<N> returnObjects, Shape shape)
focal_class.identifier: retrieve
focal_class.modifiers: protected
focal_class.parameters: (Set<N> returnObjects, Shape shape)
focal_class.return: Set<N>
focal_class.signature: Set<N> retrieve(Set<N> returnObjects, Shape shape)
focal_class.class_method_signature: SpatialQuadTree.getNodes(List<Spatial> list)
focal_class.full_signature: public List<Spatial> getNodes(List<Spatial> list)
focal_class.identifier: getNodes
focal_class.modifiers: public
focal_class.parameters: (List<Spatial> list)
focal_class.return: List<Spatial>
focal_class.signature: List<Spatial> getNodes(List<Spatial> list)
focal_class.class_method_signature: SpatialQuadTree.getGrid()
focal_class.full_signature: @Override public List<Shape> getGrid()
focal_class.identifier: getGrid
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Shape>
focal_class.signature: List<Shape> getGrid()
focal_class.class_method_signature: SpatialQuadTree.collectGrids(List<Shape> list, SpatialQuadTree<N> tree)
focal_class.full_signature: private List<Shape> collectGrids(List<Shape> list, SpatialQuadTree<N> tree)
focal_class.identifier: collectGrids
focal_class.modifiers: private
focal_class.parameters: (List<Shape> list, SpatialQuadTree<N> tree)
focal_class.return: List<Shape>
focal_class.signature: List<Shape> collectGrids(List<Shape> list, SpatialQuadTree<N> tree)
focal_class.class_method_signature: SpatialQuadTree.collectNodes(List<Spatial> list, SpatialQuadTree<N> tree)
focal_class.full_signature: private List<Spatial> collectNodes(List<Spatial> list, SpatialQuadTree<N> tree)
focal_class.identifier: collectNodes
focal_class.modifiers: private
focal_class.parameters: (List<Spatial> list, SpatialQuadTree<N> tree)
focal_class.return: List<Spatial>
focal_class.signature: List<Spatial> collectNodes(List<Spatial> list, SpatialQuadTree<N> tree)
focal_class.class_method_signature: SpatialQuadTree.getVisibleElements(Shape shape)
focal_class.full_signature: @Override public Set<N> getVisibleElements(Shape shape)
focal_class.identifier: getVisibleElements
focal_class.modifiers: @Override public
focal_class.parameters: (Shape shape)
focal_class.return: Set<N>
focal_class.signature: Set<N> getVisibleElements(Shape shape)
focal_class.class_method_signature: SpatialQuadTree.getVisibleNodes(Rectangle2D r)
focal_class.full_signature: public Set<N> getVisibleNodes(Rectangle2D r)
focal_class.identifier: getVisibleNodes
focal_class.modifiers: public
focal_class.parameters: (Rectangle2D r)
focal_class.return: Set<N>
focal_class.signature: Set<N> getVisibleNodes(Rectangle2D r)
focal_class.class_method_signature: SpatialQuadTree.getLayoutArea()
focal_class.full_signature: @Override public Rectangle2D getLayoutArea()
focal_class.identifier: getLayoutArea
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Rectangle2D
focal_class.signature: Rectangle2D getLayoutArea()
focal_class.class_method_signature: SpatialQuadTree.recalculate()
focal_class.full_signature: @Override public void recalculate()
focal_class.identifier: recalculate
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void recalculate()
focal_class.class_method_signature: SpatialQuadTree.recalculate(Collection<N> nodes)
focal_class.full_signature: private void recalculate(Collection<N> nodes)
focal_class.identifier: recalculate
focal_class.modifiers: private
focal_class.parameters: (Collection<N> nodes)
focal_class.return: void
focal_class.signature: void recalculate(Collection<N> nodes)
focal_class.class_method_signature: SpatialQuadTree.getContainingQuadTreeLeaf(N node)
focal_class.full_signature: public TreeNode getContainingQuadTreeLeaf(N node)
focal_class.identifier: getContainingQuadTreeLeaf
focal_class.modifiers: public
focal_class.parameters: (N node)
focal_class.return: TreeNode
focal_class.signature: TreeNode getContainingQuadTreeLeaf(N node)
focal_class.class_method_signature: SpatialQuadTree.getContainingLeafs(Point2D p)
focal_class.full_signature: public Set<SpatialQuadTree<N>> getContainingLeafs(Point2D p)
focal_class.identifier: getContainingLeafs
focal_class.modifiers: public
focal_class.parameters: (Point2D p)
focal_class.return: Set<SpatialQuadTree<N>>
focal_class.signature: Set<SpatialQuadTree<N>> getContainingLeafs(Point2D p)
focal_class.class_method_signature: SpatialQuadTree.getContainingLeafs(double x, double y)
focal_class.full_signature: public Set<SpatialQuadTree<N>> getContainingLeafs(double x, double y)
focal_class.identifier: getContainingLeafs
focal_class.modifiers: public
focal_class.parameters: (double x, double y)
focal_class.return: Set<SpatialQuadTree<N>>
focal_class.signature: Set<SpatialQuadTree<N>> getContainingLeafs(double x, double y)
focal_class.class_method_signature: SpatialQuadTree.getContainingLeaf(Object element)
focal_class.full_signature: @Override public TreeNode getContainingLeaf(Object element)
focal_class.identifier: getContainingLeaf
focal_class.modifiers: @Override public
focal_class.parameters: (Object element)
focal_class.return: TreeNode
focal_class.signature: TreeNode getContainingLeaf(Object element)
focal_class.class_method_signature: SpatialQuadTree.getContainingQuadTreeLeaf(Point2D p)
focal_class.full_signature: public SpatialQuadTree<N> getContainingQuadTreeLeaf(Point2D p)
focal_class.identifier: getContainingQuadTreeLeaf
focal_class.modifiers: public
focal_class.parameters: (Point2D p)
focal_class.return: SpatialQuadTree<N>
focal_class.signature: SpatialQuadTree<N> getContainingQuadTreeLeaf(Point2D p)
focal_class.class_method_signature: SpatialQuadTree.getContainingQuadTreeLeaf(double x, double y)
focal_class.full_signature: public SpatialQuadTree<N> getContainingQuadTreeLeaf(double x, double y)
focal_class.identifier: getContainingQuadTreeLeaf
focal_class.modifiers: public
focal_class.parameters: (double x, double y)
focal_class.return: SpatialQuadTree<N>
focal_class.signature: SpatialQuadTree<N> getContainingQuadTreeLeaf(double x, double y)
focal_class.class_method_signature: SpatialQuadTree.getClosestElement(Point2D p)
focal_class.full_signature: @Override public N getClosestElement(Point2D p)
focal_class.identifier: getClosestElement
focal_class.modifiers: @Override public
focal_class.parameters: (Point2D p)
focal_class.return: N
focal_class.signature: N getClosestElement(Point2D p)
focal_class.class_method_signature: SpatialQuadTree.getClosestElement(double x, double y)
focal_class.full_signature: @Override public N getClosestElement(double x, double y)
focal_class.identifier: getClosestElement
focal_class.modifiers: @Override public
focal_class.parameters: (double x, double y)
focal_class.return: N
focal_class.signature: N getClosestElement(double x, double y)
focal_class.class_method_signature: SpatialQuadTree.setBounds(Rectangle2D bounds)
focal_class.full_signature: @Override public void setBounds(Rectangle2D bounds)
focal_class.identifier: setBounds
focal_class.modifiers: @Override public
focal_class.parameters: (Rectangle2D bounds)
focal_class.return: void
focal_class.signature: void setBounds(Rectangle2D bounds)
focal_class.class_method_signature: SpatialQuadTree.update(N node, Point location)
focal_class.full_signature: @Override public void update(N node, Point location)
focal_class.identifier: update
focal_class.modifiers: @Override public
focal_class.parameters: (N node, Point location)
focal_class.return: void
focal_class.signature: void update(N node, Point location)
focal_class.class_method_signature: SpatialQuadTree.layoutChanged(LayoutEvent<N> evt)
focal_class.full_signature: @Override public void layoutChanged(LayoutEvent<N> evt)
focal_class.identifier: layoutChanged
focal_class.modifiers: @Override public
focal_class.parameters: (LayoutEvent<N> evt)
focal_class.return: void
focal_class.signature: void layoutChanged(LayoutEvent<N> evt)
focal_class.class_method_signature: SpatialQuadTree.layoutChanged(LayoutNetworkEvent<N> evt)
focal_class.full_signature: @Override public void layoutChanged(LayoutNetworkEvent<N> evt)
focal_class.identifier: layoutChanged
focal_class.modifiers: @Override public
focal_class.parameters: (LayoutNetworkEvent<N> evt)
focal_class.return: void
focal_class.signature: void layoutChanged(LayoutNetworkEvent<N> evt)
focal_class.class_method_signature: SpatialQuadTree.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: SpatialQuadTree.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: SpatialQuadTree.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.superclass: extends AbstractSpatial<N, N>
focal_method.body: @Override
    public N getClosestElement(Point2D p) {
      return getClosestElement(p.getY(), p.getY());
    }
focal_method.class_method_signature: SpatialQuadTree.getClosestElement(Point2D p)
focal_method.full_signature: @Override public N getClosestElement(Point2D p)
focal_method.identifier: getClosestElement
focal_method.invocations: getClosestElement getY getY
focal_method.modifiers: @Override public
focal_method.parameters: (Point2D p)
focal_method.return: N
focal_method.signature: N getClosestElement(Point2D p)