/// <summary> /// Search for intervals in the index which intersect the given closed interval /// and apply the visitor to them. /// </summary> /// <param name="min">The lower bound of the query interval</param> /// <param name="max">The upper bound of the query interval</param> /// <param name="visitor">The visitor to pass any matched items to</param> public void Query(double min, double max, IItemVisitor <T> visitor) { Init(); // if root is null tree must be empty if (_root == null) { return; } _root.Query(min, max, visitor); }
public override void Query(double queryMin, double queryMax, IItemVisitor <T> visitor) { if (!Intersects(queryMin, queryMax)) { // System.out.println("Does NOT Overlap branch: " + this); return; } // System.out.println("Overlaps branch: " + this); if (_node1 != null) { _node1.Query(queryMin, queryMax, visitor); } if (_node2 != null) { _node2.Query(queryMin, queryMax, visitor); } }
/// <summary> /// Search for intervals in the index which intersect the given closed interval /// and apply the visitor to them. /// </summary> /// <param name="min">The lower bound of the query interval</param> /// <param name="max">The upper bound of the query interval</param> /// <param name="visitor">The visitor to pass any matched items to</param> public void Query(double min, double max, IItemVisitor <T> visitor) { Init(); _root.Query(min, max, visitor); }