@Test public void testRemove() { PointQuadTree<String> qt = getTree(); assertEquals("(5, 20) should be removed", "Foo", qt.remove(new Vector3(5, 20))); assertEquals("(5, 20) should be removed", "Bar", qt.remove(new Vector3(50, 32))); assertEquals("(5, 20) should be removed", "Baz", qt.remove(new Vector3(47, 96))); assertEquals("(5, 20) should be removed", "Bing", qt.remove(new Vector3(50, 50))); assertEquals("(5, 20) should be removed", "Bong", qt.remove(new Vector3(12, 0))); assertEquals("(5, 20) should be removed", "Bong", qt.remove(new Vector3(99, 99))); assertNull("(6, 6) wasn\"t there to remove", qt.remove(new Vector3(6, 6))); assertTrue("Tree should be empty", qt.isEmpty()); assertTreesChildrenAreNull(qt); }
@Override public V remove(Vector3 k) { Node<V> node = this.find(this.root, k); if (node != null) { V value = node.getData().getValue(); node.setData(null); node.setNodeType(NodeType.EMPTY); this.balance(node); this.count--; return value; } else { return null; } }
PointQuadTree extends QuadTree<Vector3, V> { @Override public V remove(Vector3 k) { Node<V> node = this.find(this.root, k); if (node != null) { V value = node.getData().getValue(); node.setData(null); node.setNodeType(NodeType.EMPTY); this.balance(node); this.count--; return value; } else { return null; } } }
PointQuadTree extends QuadTree<Vector3, V> { @Override public V remove(Vector3 k) { Node<V> node = this.find(this.root, k); if (node != null) { V value = node.getData().getValue(); node.setData(null); node.setNodeType(NodeType.EMPTY); this.balance(node); this.count--; return value; } else { return null; } } PointQuadTree(float minX, float minZ, float maxX, float maxZ);  PointQuadTree(Vector3 startPoint,Vector3 endPoint); }
PointQuadTree extends QuadTree<Vector3, V> { @Override public V remove(Vector3 k) { Node<V> node = this.find(this.root, k); if (node != null) { V value = node.getData().getValue(); node.setData(null); node.setNodeType(NodeType.EMPTY); this.balance(node); this.count--; return value; } else { return null; } } PointQuadTree(float minX, float minZ, float maxX, float maxZ);  PointQuadTree(Vector3 startPoint,Vector3 endPoint); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override void set(Vector3 k, V v); @Override V get(Vector3 k, V defaultValue); @Override Node<V> find(Node<V> node, Vector3 vector3); @Override V remove(Vector3 k); @SuppressWarnings("unchecked") @Override List<PointData<V>> getKeyValues(); @Override List<Vector3> getKeys(); @Override List<V> getValues(); void traverse(Node<V> node, Func<V> func); List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax,
			final double ymax); List<PointData<V>> searchWithin(final float xmin, final float zmin, final float xmax, final float zmax); List<PointData<V>> searchWithin(Vector3 point, float radius); PointQuadTree<V> clone(); }
PointQuadTree extends QuadTree<Vector3, V> { @Override public V remove(Vector3 k) { Node<V> node = this.find(this.root, k); if (node != null) { V value = node.getData().getValue(); node.setData(null); node.setNodeType(NodeType.EMPTY); this.balance(node); this.count--; return value; } else { return null; } } PointQuadTree(float minX, float minZ, float maxX, float maxZ);  PointQuadTree(Vector3 startPoint,Vector3 endPoint); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override void set(Vector3 k, V v); @Override V get(Vector3 k, V defaultValue); @Override Node<V> find(Node<V> node, Vector3 vector3); @Override V remove(Vector3 k); @SuppressWarnings("unchecked") @Override List<PointData<V>> getKeyValues(); @Override List<Vector3> getKeys(); @Override List<V> getValues(); void traverse(Node<V> node, Func<V> func); List<PointData<V>> searchIntersect(final double xmin, final double ymin, final double xmax,
			final double ymax); List<PointData<V>> searchWithin(final float xmin, final float zmin, final float xmax, final float zmax); List<PointData<V>> searchWithin(Vector3 point, float radius); PointQuadTree<V> clone();  }