Constructor and Description |
---|
Cylinder()
Construct a Cylinder object using the default value for
radius and depth.
|
Cylinder(Cylinder x)
This is the copy constructor.
|
Cylinder(double theRadius,
double theDepth)
Construct a Cylinder object using the arguments.
|
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 Cylinder object that
has the same radius and depth as this Cylinder.
|
double |
getDepth()
Get the depth of this Cylinder.
|
double |
getPerimeter()
Get the perimeter of this Cylinder.
|
double |
getSurfaceArea()
Get the surface area of this Cylinder.
|
double |
getVolume()
Get the volume of this Cylinder.
|
void |
setDepth(double theDepth)
Reset the depth of this Cylinder.
|
java.lang.String |
toString()
Returns a String object representing this Cylinder's value.
|
getShapeName
public Cylinder()
public Cylinder(double theRadius, double theDepth)
theRadius
- the radius for this CylindertheDepth
- the depth for this Cylinderpublic Cylinder(Cylinder x)
x
- is the Cylinder to be duplicated.public double getSurfaceArea()
getSurfaceArea
in class Circle
public double getPerimeter()
getPerimeter
in class Circle
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