public class SpaceObject extends SynchronizedPropertyObject implements ISpaceObject
Modifier and Type | Field and Description |
---|---|
protected SimpleValueFetcher |
fetcher
The fetcher.
|
protected java.lang.Object |
id
The object's ID.
|
protected AbstractEnvironmentSpace |
space
The space.
|
protected MultiCollection<java.lang.Object,IResultListener<?>> |
tasklisteners
The task listeners.
|
protected java.util.Map |
tasks
The object's tasks.
|
protected java.lang.String |
typename
The object's typename.
|
monitor
pcs, properties
PROPERTY_OWNER
Constructor and Description |
---|
SpaceObject(java.lang.Object id,
MObjectType type,
java.util.Map properties,
java.util.List tasks,
java.lang.Object monitor,
AbstractEnvironmentSpace space)
Creates a new EnvironmentObject.
|
Modifier and Type | Method and Description |
---|---|
void |
addTask(IObjectTask task)
Adds a new task for the object.
|
void |
addTaskListener(java.lang.Object taskid,
IResultListener listener)
Add a result listener to a task.
|
void |
clearTasks()
Removes all tasks from the object.
|
java.lang.Object |
getId()
Get the objects id.
|
java.util.Map |
getProperties()
Bean accessor.
|
java.lang.Object |
getProperty(java.lang.String name)
Returns a property.
|
IObjectTask |
getTask(java.lang.Object id)
Get a specific task.
|
java.util.Collection |
getTasks()
Returns all tasks of the object for introspection.
|
java.lang.String |
getType()
Returns the type of the object.
|
boolean |
hasProperty(java.lang.String name)
Test if has a property.
|
void |
removeTask(java.lang.Object taskid,
java.lang.Exception e)
Removes a task from the object.
|
void |
removeTaskListener(java.lang.Object taskid,
IResultListener listener)
Remove a result listener from a task.
|
void |
setId(java.lang.Object id)
Set the id of the object.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Only for debugging.
|
void |
setType(java.lang.String type)
Set the type of the object.
|
java.lang.String |
toString()
Get the string representation.
|
void |
updateObject(IEnvironmentSpace space,
long progress,
IClockService clock)
Updates the object to the current time.
|
addPropertyChangeListener, getMonitor, getPropertyNames, removePropertyChangeListener
getMetaData, getMetaDatas
setProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMetaData, getMetaDatas
getPropertyNames
protected java.lang.Object id
protected java.lang.String typename
protected java.util.Map tasks
protected MultiCollection<java.lang.Object,IResultListener<?>> tasklisteners
protected SimpleValueFetcher fetcher
protected AbstractEnvironmentSpace space
public SpaceObject(java.lang.Object id, MObjectType type, java.util.Map properties, java.util.List tasks, java.lang.Object monitor, AbstractEnvironmentSpace space)
objectId
- the object's IDtypename
- the object's typeproperties
- initial properties (may be null)propertiesMeta
- the meta data of the propertiestasks
- initial task list (may be null)public java.lang.Object getProperty(java.lang.String name)
getProperty
in interface IPropertyObject
getProperty
in class SynchronizedPropertyObject
name
- name of the propertypublic void setProperty(java.lang.String name, java.lang.Object value)
setProperty
in interface IPropertyObject
setProperty
in class SynchronizedPropertyObject
name
- name of the propertyvalue
- value of the propertypublic java.lang.Object getId()
getId
in interface ISpaceObject
public void setId(java.lang.Object id)
public java.lang.String getType()
getType
in interface ISpaceObject
public void setType(java.lang.String type)
public void addTask(IObjectTask task)
task
- new taskpublic void removeTask(java.lang.Object taskid, java.lang.Exception e)
task
- The task.public java.util.Collection getTasks()
public IObjectTask getTask(java.lang.Object id)
id
- The task id.public void clearTasks()
public void addTaskListener(java.lang.Object taskid, IResultListener listener)
public void removeTaskListener(java.lang.Object taskid, IResultListener listener)
public void updateObject(IEnvironmentSpace space, long progress, IClockService clock)
progress
- The time that has passed according to the environment executor.clock
- The clock service.public java.util.Map getProperties()
getProperties
in class SimplePropertyObject
public boolean hasProperty(java.lang.String name)
hasProperty
in interface IPropertyObject
hasProperty
in class SynchronizedPropertyObject
name
- the name of the property to testtrue
if and only if the property existspublic java.lang.String toString()
toString
in class SimplePropertyObject