public class VizObject extends java.lang.Object implements IVizObject, IVizUpdateable
VizObject is the base class for all common, shared data structures in Viz geometry and mesh bundles. ICEObjects are uniquely identifiable by their identification numbers and are persistent. VizObject implements clone() for creating deep copies and also provides a public copy operation to copy into an existing VizObject. VizObjects can be marshaled and unmarshaled to XML using the loadFromXML() and persistToXML().
Operations are defined for most of the attributes and capabilities of the VizObject class, but some work is required by subclasses. Subclasses must override clone() if they extend VizObject by adding attributes or the deep copy will fail. They should provide a custom implementation of copy() that is specific to their own type to do a deep copy (i.e. copy(a:myType) instead of copy(a:VizObject)) since VizObject.copy() will only copy the attributes of VizObjects. They must also override the loadFromXML() operation to copy the XML data properly from the XMLLoader (because Viz uses JAXB to bind XML to VizObjects and its subclasses).
VizObjects implement IVizUpdateable. The base class manages registering, unregistering and notifications. Subclasses are expected to override update().
iComponentListener
Constructor and Description |
---|
VizObject()
The Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
This operation returns a clone of the ICEObject using a deep copy.
|
void |
copy(VizObject entity)
This operation copies the contents of an ICEObject into the current
object using a deep copy.
|
boolean |
equals(java.lang.Object otherObject)
(non-Javadoc)
|
java.lang.String |
getDescription()
(non-Javadoc)
|
int |
getId()
(non-Javadoc)
|
java.lang.String |
getName()
(non-Javadoc)
|
int |
hashCode()
(non-Javadoc)
|
void |
register(IVizUpdateableListener listener)
(non-Javadoc)
|
void |
setDescription(java.lang.String description)
(non-Javadoc)
|
void |
setId(int id)
(non-Javadoc)
|
void |
setName(java.lang.String name)
(non-Javadoc)
|
void |
unregister(IVizUpdateableListener listener)
(non-Javadoc)
|
void |
update(java.lang.String updatedKey,
java.lang.String newValue)
(non-Javadoc)
|
public void setId(int id)
IVizObject
setId
in interface IVizObject
Identifiable#setId(int id)
public int getId()
IVizObject
getId
in interface IVizObject
Identifiable#getId()
public void setName(java.lang.String name)
IVizObject
setName
in interface IVizObject
Identifiable#setName(String name)
public java.lang.String getName()
IVizObject
getName
in interface IVizObject
Identifiable#getName()
public void setDescription(java.lang.String description)
IVizObject
setDescription
in interface IVizObject
Identifiable#setDescription(String description)
public java.lang.String getDescription()
IVizObject
getDescription
in interface IVizObject
Identifiable#getDescription()
public void copy(VizObject entity)
copy
in interface IVizObject
entity
- The Identifiable entity from which the values should be
copied.public java.lang.Object clone()
This operation returns a clone of the ICEObject using a deep copy.
clone
in interface IVizObject
clone
in class java.lang.Object
The new clone.
public boolean equals(java.lang.Object otherObject)
IVizObject
equals
in interface IVizObject
equals
in class java.lang.Object
Identifiable#equals(Object otherObject)
public int hashCode()
IVizObject
hashCode
in interface IVizObject
hashCode
in class java.lang.Object
Identifiable#hashCode()
public void update(java.lang.String updatedKey, java.lang.String newValue)
update
in interface IVizObject
update
in interface IVizUpdateable
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 register(IVizUpdateableListener listener)
register
in interface IVizObject
register
in interface IVizUpdateable
listener
- The new listener that should be notified when the the Component's state changes.
IUpdateable#register(IUpdateableListener listener)
public void unregister(IVizUpdateableListener listener)
IVizObject
unregister
in interface IVizObject
unregister
in interface IVizUpdateable
listener
- The listener that should no longer receive updates.
IUpdateable#unregister(IUpdateableListener listener)