mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 08:59:01 +00:00
Added iteration logic.
This commit is contained in:
@@ -30,4 +30,9 @@ public class Rectangle {
|
||||
boolean intersectsWith(Rectangle r) {
|
||||
return !(r.getLeft() > getRight() || r.getRight() < getLeft() || r.getTop() > getBottom() || r.getBottom() < getTop());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("[%d,%d,%d,%d]", getLeft(), getTop(), getRight(), getBottom());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user