public class ICEObject extends java.lang.Object implements IUpdateable
ICEObject is the base class for all common, shared data structures in ICE with the notable exception of the ICEList. ICEObjects are uniquely identifiable by their identification numbers and are persistent; it realizes both the Identifiable and Persistable interfaces. ICEObject implements clone() for creating deep copies and also provides a public copy operation to copy into an existing ICEObject. ICEObjects can be marshalled and unmarshalled to XML using the loadFromXML() and persistToXML() operations from the Persistable interface.
Operations are defined for most of the attributes and capabilities of the ICEObject class, but some work is required by subclasses. Subclasses must override clone() if they extend ICEObject 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:ICEObject)) since ICEObject.copy() will only copy the attributes of ICEObjects. They must also override the loadFromXML() operation to copy the XML data properly from the XMLLoader (because ICE uses JAXB to bind XML to ICEObjects and its subclasses).
ICEObjects implement IUpdateable. The base class manages registering, unregistering and notifications. Subclasses are expected to override update().
iComponentListener
Constructor and Description |
---|
ICEObject()
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(ICEObject 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(IUpdateableListener 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(IUpdateableListener listener)
(non-Javadoc)
|
void |
update(java.lang.String updatedKey,
java.lang.String newValue)
(non-Javadoc)
|
public void setId(int id)
setId
in interface Identifiable
id
- The unique identification number that should be assigned to the Identifiable entity.
Identifiable.setId(int id)
public int getId()
getId
in interface Identifiable
The unique identification number of the Identifiable entity.
Identifiable.getId()
public void setName(java.lang.String name)
setName
in interface Identifiable
name
- The name that should be given to the Identifiable entity.
Identifiable.setName(String name)
public java.lang.String getName()
getName
in interface Identifiable
The name of the Identifiable entity.
Identifiable.getName()
public void setDescription(java.lang.String description)
setDescription
in interface Identifiable
description
- The description that should be stored for the Identifiable entity.
Identifiable.setDescription(String description)
public java.lang.String getDescription()
getDescription
in interface Identifiable
The description of the Identifiable entity.
Identifiable.getDescription()
public void copy(ICEObject entity)
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 Identifiable
clone
in class java.lang.Object
The new clone.
public boolean equals(java.lang.Object otherObject)
equals
in interface Identifiable
equals
in class java.lang.Object
otherObject
- The other Identifiable entity that should be compared with this one.
True if the Identifiable entitys are equal, false otherwise.
Identifiable.equals(Object otherObject)
public int hashCode()
hashCode
in interface Identifiable
hashCode
in class java.lang.Object
The hashcode of the Identifiable entity.
Identifiable.hashCode()
public void update(java.lang.String updatedKey, java.lang.String newValue)
update
in interface IUpdateable
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(IUpdateableListener listener)
register
in interface IUpdateable
listener
- The new listener that should be notified when the the Component's state changes.
IUpdateable.register(IUpdateableListener listener)
public void unregister(IUpdateableListener listener)
unregister
in interface IUpdateable
listener
- The listener that should no longer receive updates.
IUpdateable.unregister(IUpdateableListener listener)