public class ComplexShape extends AbstractShape
Represents an ordered collection of shape components which are applied to a parent set operator
Through the geometry composite pattern, an instance of ComplexShape is always a parent of PrimitiveShapes, other ComplexShapes, or a collection of both types.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
ComplexShape()
Calls AbstractShape's constructor and sets the operator type to None
|
ComplexShape(OperatorType operatorType)
Calls AbstractShape's constructor and sets the operator type to the given
value
|
Modifier and Type | Method and Description |
---|---|
void |
acceptShapeVisitor(IShapeVisitor visitor)
(non-Javadoc)
|
void |
addShape(IShape shape)
Appends a single shape to the end of the shape list
|
java.lang.Object |
clone()
This operation returns a clone of the ComplexShape using a deep copy.
|
void |
copy(ComplexShape iceObject)
This operation copies the contents of a ComplexShape into the current
object using a deep copy.
|
boolean |
equals(java.lang.Object otherObject)
This operation is used to check equality between this ComplexShape and
another ComplexShape.
|
java.util.ArrayList<IShape> |
getShapes()
Returns a reference to the list of shapes containing in this ComplexShape
|
OperatorType |
getType()
Returns the OperatorType of the ComplexShape
|
int |
hashCode()
This operation returns the hashcode value of the ComplexShape.
|
void |
removeShape(IShape shape)
Removes a single shape from the shape list
|
void |
setShapes(java.util.ArrayList<IShape> shapes)
Replaces the list of shapes with the given ArrayList
|
void |
setType(OperatorType operatorType)
Accepts all values of the OperatorType enumerator
|
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 ComplexShape()
Calls AbstractShape's constructor and sets the operator type to None
public ComplexShape(OperatorType operatorType)
Calls AbstractShape's constructor and sets the operator type to the given value
operatorType
- The OperatorType to set for the new ComplexShape
public void setType(OperatorType operatorType)
Accepts all values of the OperatorType enumerator
Once the OperatorType has been set to a value which is not None, the OperatorType cannot be changed. Any additional calls to this operation will be ignored.
operatorType
- The type of the geometry set operator to be applied to this set of shapes
public OperatorType getType()
Returns the OperatorType of the ComplexShape
Type of the geometry set operator applied to this set of shapes
public void addShape(IShape shape)
Appends a single shape to the end of the shape list
shape
- The shape to be added
public void removeShape(IShape shape)
Removes a single shape from the shape list
shape
- The shape reference to find and remove from the ComplexShape
public java.util.ArrayList<IShape> getShapes()
Returns a reference to the list of shapes containing in this ComplexShape
List of shapes contained in the ComplexShape
public void setShapes(java.util.ArrayList<IShape> shapes)
Replaces the list of shapes with the given ArrayList
shapes
- The list of shapes which will replace the old list
public int hashCode()
This operation returns the hashcode value of the ComplexShape.
hashCode
in interface Identifiable
hashCode
in class AbstractShape
The hashcode of the ICEObject.
Identifiable.hashCode()
public boolean equals(java.lang.Object otherObject)
This operation is used to check equality between this ComplexShape and another ComplexShape. It returns true if the ComplexShapes 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(ComplexShape iceObject)
This operation copies the contents of a ComplexShape 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 ComplexShape using a deep copy.
clone
in interface Identifiable
clone
in class ICEObject
The new clone.
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)