@Test public void toStringTest() { Rectangle rectangle = create(1, 2, 3, 4); Assert.assertEquals(RECTANGLE_TO_STRING, rectangle.toString()); }
@Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("left="); stringBuilder.append(this.left); stringBuilder.append(", top="); stringBuilder.append(this.top); stringBuilder.append(", right="); stringBuilder.append(this.right); stringBuilder.append(", bottom="); stringBuilder.append(this.bottom); return stringBuilder.toString(); }
Rectangle implements Serializable { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("left="); stringBuilder.append(this.left); stringBuilder.append(", top="); stringBuilder.append(this.top); stringBuilder.append(", right="); stringBuilder.append(this.right); stringBuilder.append(", bottom="); stringBuilder.append(this.bottom); return stringBuilder.toString(); } }
Rectangle implements Serializable { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("left="); stringBuilder.append(this.left); stringBuilder.append(", top="); stringBuilder.append(this.top); stringBuilder.append(", right="); stringBuilder.append(this.right); stringBuilder.append(", bottom="); stringBuilder.append(this.bottom); return stringBuilder.toString(); } Rectangle(double left, double top, double right, double bottom); }
Rectangle implements Serializable { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("left="); stringBuilder.append(this.left); stringBuilder.append(", top="); stringBuilder.append(this.top); stringBuilder.append(", right="); stringBuilder.append(this.right); stringBuilder.append(", bottom="); stringBuilder.append(this.bottom); return stringBuilder.toString(); } Rectangle(double left, double top, double right, double bottom); boolean contains(Point point); Rectangle enlarge(double left, double top, double right, double bottom); Rectangle envelope(double padding); @Override boolean equals(Object obj); Point getCenter(); double getCenterX(); double getCenterY(); double getHeight(); double getWidth(); @Override int hashCode(); boolean intersects(Rectangle rectangle); boolean intersectsCircle(double pointX, double pointY, double radius); Rectangle shift(Point origin); @Override String toString(); }
Rectangle implements Serializable { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("left="); stringBuilder.append(this.left); stringBuilder.append(", top="); stringBuilder.append(this.top); stringBuilder.append(", right="); stringBuilder.append(this.right); stringBuilder.append(", bottom="); stringBuilder.append(this.bottom); return stringBuilder.toString(); } Rectangle(double left, double top, double right, double bottom); boolean contains(Point point); Rectangle enlarge(double left, double top, double right, double bottom); Rectangle envelope(double padding); @Override boolean equals(Object obj); Point getCenter(); double getCenterX(); double getCenterY(); double getHeight(); double getWidth(); @Override int hashCode(); boolean intersects(Rectangle rectangle); boolean intersectsCircle(double pointX, double pointY, double radius); Rectangle shift(Point origin); @Override String toString(); final double bottom; final double left; final double right; final double top; }