public class PrimitiveShape extends AbstractShape
Represents a mathematically simple solid with no child shapes
This is the leaf node of the composite pattern consisting of the ComplexShape and PrimitiveShape
iComponentVisitor
iComponentListener
Constructor and Description |
---|
PrimitiveShape()
Calls AbstractShape's constructor and initializes the ShapeType
|
PrimitiveShape(ShapeType shapeType)
Calls AbstractShape's constructor and initializes the ShapeType
|
Modifier and Type | Method and Description |
---|---|
void |
acceptShapeVisitor(IShapeVisitor visitor)
(non-Javadoc)
|
java.lang.Object |
clone()
This operation returns a clone of the PrimitiveShape using a deep copy.
|
void |
copy(PrimitiveShape iceObject)
This operation copies the contents of a PrimitiveShape into the current
object using a deep copy.
|
boolean |
equals(java.lang.Object otherObject)
This operation is used to check equality between the PrimitiveShape and
another PrimitiveShape.
|
ShapeType |
getType()
Gets the ShapeType of the PrimitiveShape
|
int |
hashCode()
This operation returns the hashcode value of the PrimitiveShape.
|
void |
setType(ShapeType shapeType)
Sets the type of shape of the PrimitiveShape
|
void |
update(java.lang.String updatedKey,
java.lang.String newValue)
(non-Javadoc)
|
accept, copy, getParent, getProperty, getTransformation, removeProperty, setProperty, setTransformation
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister
getClass, notify, notifyAll, toString, wait, wait, wait
register, unregister
getDescription, getId, getName, setDescription, setId, setName
public PrimitiveShape()
Calls AbstractShape's constructor and initializes the ShapeType
Upon creation, the associated ShapeType is set to None and must be reset appropriately in order for the PrimitiveShape to have an effect on a generated mesh.
public PrimitiveShape(ShapeType shapeType)
Calls AbstractShape's constructor and initializes the ShapeType
When this constructor is called, the ShapeType enumerator is set to the given value.
shapeType
- The type of shape to be set in this new PrimitiveShape
public void setType(ShapeType shapeType)
Sets the type of shape of the PrimitiveShape
If the shape type has previously been set, this operation ignores additional calls to this function. That is, the shape type is permitted to change only if the current shape type is None.
shapeType
- The type of shape to set on this PrimitiveShape
public ShapeType getType()
Gets the ShapeType of the PrimitiveShape
The ShapeType corresponding to this PrimitiveShape
public boolean equals(java.lang.Object otherObject)
This operation is used to check equality between the PrimitiveShape and another PrimitiveShape. It returns true if the PrimitiveShapes are equal and false if they are not.
equals
in interface Identifiable
equals
in class AbstractShape
otherObject
- The other ICEObject that should be compared with this one.
True if the ICEObjects are equal, false otherwise.
Identifiable.equals(Object otherObject)
public void copy(PrimitiveShape iceObject)
This operation copies the contents of a PrimitiveShape into the current object using a deep copy.
iceObject
- The ICEObject from which the values should be copied.
public java.lang.Object clone()
This operation returns a clone of the PrimitiveShape using a deep copy.
clone
in interface Identifiable
clone
in class ICEObject
The new clone.
public int hashCode()
This operation returns the hashcode value of the PrimitiveShape.
hashCode
in interface Identifiable
hashCode
in class AbstractShape
The hashcode of the ICEObject.
Identifiable.hashCode()
public void update(java.lang.String updatedKey, java.lang.String newValue)
update
in interface IUpdateable
update
in class ICEObject
updatedKey
- A unique key that describes the value that to be updated.
newValue
- The updated value of the key.
IUpdateable.update(String updatedKey, String newValue)
public void acceptShapeVisitor(IShapeVisitor visitor)
visitor
- The IShapeVisitor to call back in order to reveal the type of this IShape
IShape.acceptShapeVisitor(IShapeVisitor visitor)