Class SpaceObject

    • Field Detail

      • id

        protected java.lang.Object id
        The object's ID.
      • typename

        protected java.lang.String typename
        The object's typename.
      • tasks

        protected java.util.Map tasks
        The object's tasks.
    • Constructor Detail

      • SpaceObject

        public 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.
        Parameters:
        objectId - the object's ID
        typename - the object's type
        properties - initial properties (may be null)
        propertiesMeta - the meta data of the properties
        tasks - initial task list (may be null)
    • Method Detail

      • getId

        public java.lang.Object getId()
        Get the objects id.
        Specified by:
        getId in interface ISpaceObject
        Returns:
        The object id.
      • setId

        public void setId​(java.lang.Object id)
        Set the id of the object.
      • getType

        public java.lang.String getType()
        Returns the type of the object.
        Specified by:
        getType in interface ISpaceObject
        Returns:
        the type
      • setType

        public void setType​(java.lang.String type)
        Set the type of the object.
      • addTask

        public void addTask​(IObjectTask task)
        Adds a new task for the object.
        Parameters:
        task - new task
      • removeTask

        public void removeTask​(java.lang.Object taskid,
                               java.lang.Exception e)
        Removes a task from the object.
        Parameters:
        task - The task.
      • getTasks

        public java.util.Collection getTasks()
        Returns all tasks of the object for introspection.
        Returns:
        all tasks of the object
      • getTask

        public IObjectTask getTask​(java.lang.Object id)
        Get a specific task.
        Parameters:
        id - The task id.
        Returns:
        The task.
      • clearTasks

        public void clearTasks()
        Removes all tasks from the object.
      • addTaskListener

        public void addTaskListener​(java.lang.Object taskid,
                                    IResultListener listener)
        Add a result listener to a task. The result will be the task id. If the task is already finished, the listener will be notified.
      • removeTaskListener

        public void removeTaskListener​(java.lang.Object taskid,
                                       IResultListener listener)
        Remove a result listener from a task.
      • updateObject

        public void updateObject​(IEnvironmentSpace space,
                                 long progress,
                                 IClockService clock)
        Updates the object to the current time. time the current time
        Parameters:
        progress - The time that has passed according to the environment executor.
        clock - The clock service.
      • getProperties

        public java.util.Map getProperties()
        Bean accessor. For serializing a space object, replace dynamic expressions with current values.
        Overrides:
        getProperties in class SimplePropertyObject
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class SimplePropertyObject
        Returns:
        The string representation.