public class Pipe extends GeometricalComponent
A simple pipe component.
A pipe is defined by its position, direction, length and area.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
Pipe()
Nullary constructor.
|
Pipe(double length,
double radius) |
Modifier and Type | Method and Description |
---|---|
void |
accept(IPlantComponentVisitor visitor)
Accepts PlantComponentVisitors to reveal the type of a PlantComponent.
|
java.lang.Object |
clone()
Performs a deep copy and returns a newly instantiated Object.
|
void |
copy(Pipe otherObject)
Deep copies the contents of otherObject.
|
boolean |
equals(java.lang.Object otherObject)
Performs an equality check between two Objects.
|
double |
getLength() |
double |
getRadius() |
int |
hashCode()
Returns the hashCode of the object.
|
void |
setLength(double length) |
void |
setRadius(double radius) |
copy, getNumElements, getOrientation, getPosition, getRotation, setNumElements, setOrientation, setPosition, setRotation
accept, copy, toString
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister, update
register, unregister, update
getDescription, getId, getName, setDescription, setId, setName
public Pipe()
Nullary constructor.
public Pipe(double length, double radius)
length
- Length of the pipe.
radius
- Radius of the pipe.
public double getLength()
public void setLength(double length)
length
- the length to setpublic double getRadius()
public void setRadius(double radius)
radius
- the radius to setpublic boolean equals(java.lang.Object otherObject)
Performs an equality check between two Objects.
equals
in interface Identifiable
equals
in class GeometricalComponent
otherObject
- The other Object to compare against.
Returns true if the two objects are equal, otherwise false.
Identifiable.equals(Object otherObject)
public java.lang.Object clone()
Performs a deep copy and returns a newly instantiated Object.
clone
in interface Identifiable
clone
in class GeometricalComponent
The newly instantiated Object.
public void copy(Pipe otherObject)
Deep copies the contents of otherObject.
otherObject
- The other object to copy the contents from.
public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class GeometricalComponent
The hashCode of the Object.
Identifiable.hashCode()
public void accept(IPlantComponentVisitor visitor)
Accepts PlantComponentVisitors to reveal the type of a PlantComponent.
accept
in class GeometricalComponent
visitor
- The PlantComponent's visitor.