Constructor and Description |
---|
RectanglePrism()
Construct a Cube object using the default size
for its length, height and depth.
|
RectanglePrism(double theLength,
double theHeight,
double theDepth)
Construct a Cube object using the arguments.
|
RectanglePrism(RectanglePrism x)
This is the copy constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ThreeD a)
Using getVolume to determine the comparison result as follows:
-1 if (this.getVolume() < a.getVolume()); 0 if (this.getVolume() = a.getVolume()); 1 if (this.getVolume() > a.getVolume()); |
boolean |
equals(java.lang.Object o)
Returns true if and only if the argument is not
null and is a RectanglePrism object that
has the same length, height and depth as this RectanglePrism.
|
double |
getDepth()
Get the depth of this Cube.
|
double |
getPerimeter()
Get the perimeter of this Cube.
|
double |
getSurfaceArea()
Get the surface area of this Cube.
|
double |
getVolume()
Get the volume of this RectanglePrism.
|
void |
setDepth(double theDepth)
Set the depth of this Cube.
|
java.lang.String |
toString()
Returns a String object representing this Cube's value.
|
getShapeName
public RectanglePrism()
public RectanglePrism(double theLength, double theHeight, double theDepth)
theLength
- the length of this Cube; must be > 0theHeight
- the height of this Cube; must be > 0theDepth
- the depth of this Cube; must be > 0public RectanglePrism(RectanglePrism x)
x
- is the RectanglePrism to be duplicated.public double getSurfaceArea()
getSurfaceArea
in class Rectangle
public double getPerimeter()
getPerimeter
in class Rectangle
public double getVolume()
public double getDepth()
public void setDepth(double theDepth)
public java.lang.String toString()
public boolean equals(java.lang.Object o)
public int compareTo(ThreeD a)
compareTo
in interface java.lang.Comparable<ThreeD>
a
- is a ThreeD object