QuadRectangle implements Serializable { public boolean contains(double x, double y) { return x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height; } QuadRectangle(Envelope envelope);  QuadRectangle(double x, double y, double width, double height); boolean contains(double x, double y); boolean contains(QuadRectangle r); int getUniqueId(); Envelope getEnvelope(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); final double x; public Integer partitionId; public String lineage; }
@Test public void testContains() { QuadRectangle r1 = makeRect(0, 0, 10, 10); QuadRectangle r2 = makeRect(0, 0, 10, 10); assertTrue(r1.contains(r2)); assertTrue(r1.contains(makeRect(5, 5, 0, 0))); QuadRectangle r3 = makeRect(0, 0, 11, 10); assertFalse(r1.contains(r3)); assertFalse(r1.contains(makeRect(5, 12, 0, 0))); }