I don't know what exactly you mean by finding all points inside a box. There is just too many!
I would suggest using an Identifier function, i.e., given a point (x, y), I(x, y) = 1 if and only if the point (x, y) is inside your box.
A call to the identifier in your example requires $4$ comparisons.
public class Box {
/**
* Identifier function.
* @param x x-coordinate of input point
* @param y y-coordinate of input point
* @return True if and only if the given point is inside the box.
*/
public boolean IsInside(double x, double y) {
return (this.x_min <= x) && (this.x_max >= x) &&
(this.y_max >= y) && (this.y_min <= y);
}
double x_min, x_max, y_min, y_max; // or do it with left top width and height
}
I hope it helps.