@Test public void equals() { assertNotEquals(R, "SDF"); for (Rectangle r1 : RALL) { for (Rectangle r2 : RALL) { if (r1 == r2) { assertEquals(r1, r2); assertEquals(r1, Rectangle.create(r2.getTopLeft(), r2.getBottomRight())); } else { assertNotEquals(r1, r2); } } } }
@Override public boolean equals(Object obj) { return this == obj || obj instanceof Rectangle && equals((Rectangle) obj); }
Rectangle extends Area { @Override public boolean equals(Object obj) { return this == obj || obj instanceof Rectangle && equals((Rectangle) obj); } }
Rectangle extends Area { @Override public boolean equals(Object obj) { return this == obj || obj instanceof Rectangle && equals((Rectangle) obj); } Rectangle(double topLeftLatitude, double topLeftLongitude, double bottomRightLatitude, double bottomRightLongitude); }
Rectangle extends Area { @Override public boolean equals(Object obj) { return this == obj || obj instanceof Rectangle && equals((Rectangle) obj); } Rectangle(double topLeftLatitude, double topLeftLongitude, double bottomRightLatitude, double bottomRightLongitude); boolean contains(double latitude, double longitude); boolean contains(Position position); @Override boolean equals(Object obj); Position getBottomRight(); Position getBottomLeft(); double getBottomRightLatitude(); double getBottomRightLongitude(); @Override Rectangle getBoundingBox(); @Override Position getRandomPosition(Random r); Position getTopLeft(); Position getTopRight(); double getTopLeftLatitude(); double getTopLeftLongitude(); @Override int hashCode(); Rectangle immutable(); @Override boolean intersects(Area other); boolean intersects(Circle other); boolean intersects(Rectangle other); @Override String toString(); static Rectangle create(Position topLeft, Position bottomRight); static Rectangle fromJSON(CharSequence string); }
Rectangle extends Area { @Override public boolean equals(Object obj) { return this == obj || obj instanceof Rectangle && equals((Rectangle) obj); } Rectangle(double topLeftLatitude, double topLeftLongitude, double bottomRightLatitude, double bottomRightLongitude); boolean contains(double latitude, double longitude); boolean contains(Position position); @Override boolean equals(Object obj); Position getBottomRight(); Position getBottomLeft(); double getBottomRightLatitude(); double getBottomRightLongitude(); @Override Rectangle getBoundingBox(); @Override Position getRandomPosition(Random r); Position getTopLeft(); Position getTopRight(); double getTopLeftLatitude(); double getTopLeftLongitude(); @Override int hashCode(); Rectangle immutable(); @Override boolean intersects(Area other); boolean intersects(Circle other); boolean intersects(Rectangle other); @Override String toString(); static Rectangle create(Position topLeft, Position bottomRight); static Rectangle fromJSON(CharSequence string); static final Rectangle ALL; static final MessageSerializer<Rectangle> SERIALIZER; }