java.lang.Comparable<Shape>
public class Rectangle extends Shape
Constructor | Description |
---|---|
Rectangle(Point a,
Point b,
Point c,
Point d) |
Initializes a newly created Rectangle object.
|
Modifier and Type | Method | Description |
---|---|---|
double |
calculateArea() |
Calculates the area of the rectangle.
|
double |
calculatePerimeter() |
Calculates the perimeter of the rectangle.
|
boolean |
equals(java.lang.Object o) |
Compares this rectangle to a specified object.
|
double |
getLength() |
Calculates the length of the rectangle.
|
double |
getWidth() |
Calculates the width of the rectangle.
|
int |
hashCode() |
hashCode auto-generated using intelliJ.
|
public Rectangle(Point a, Point b, Point c, Point d)
a
- initial value for Point ab
- initial value for Point bc
- initial value for Point cd
- initial value for Point dpublic double getWidth()
public double getLength()
public double calculateArea()
calculateArea
in class Shape
public double calculatePerimeter()
calculatePerimeter
in class Shape
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare the rectangle againstpublic int hashCode()
hashCode
in class java.lang.Object