gsim.core.objects
Interface AgentClassIF

All Superinterfaces:
ObjectClassIF, java.io.Serializable

public interface AgentClassIF
extends ObjectClassIF

The AgentClassIF is an interface to the frame representing an agent.

Author:
Stephan

Method Summary
 void addOrSetObject(java.lang.String list, ObjectClassIF object)
          Adds the object class if the object class is not yet defined, or updates it otherwise.
 BehaviourIF getBehaviour()
          Gets the behaviour associated with this agent.
 java.lang.String[] getObjectListNames()
          Gets the names of all object lists that are defined for this agent.
 ObjectClassIF getObjectListType(java.lang.String listName)
          Gets the type of object for a particular list.
 ObjectClassIF[] getObjects(java.lang.String list)
          Gets the default objects in a list.
 boolean isDeclaredObject(java.lang.String list, java.lang.String objectName)
          Tests whether an object class was defined in this agent, or whether it was defined somewhere up in the inheritance hierarchy.
 void removeObject(java.lang.String list, ObjectClassIF object)
          Removes an object class from a list.
 void removeObject(java.lang.String list, java.lang.String objectName)
          Removes an object class, identified by name only, from a list.
 java.lang.Object resolveName(java.lang.String path)
          Resolves a path into the object it references.
 void setBehaviour(BehaviourIF behaviour)
          Sets the behaviour of this agent.
 gsim.def.objects.Unit toUnit()
          This method returns the underlying entity (Frame or Instance).
 
Methods inherited from interface gsim.core.objects.ObjectClassIF
addAttribute, destroy, getAttribute, getAttributeListNames, getAttributes, getDefaultValue, getName, isDeclaredAttribute, setAttribute, setDefaultAttributeValue
 

Method Detail

addOrSetObject

void addOrSetObject(java.lang.String list,
                    ObjectClassIF object)
                    throws GSimObjectException
Adds the object class if the object class is not yet defined, or updates it otherwise.

Parameters:
list - the list where to add the object class.
object - the object class to add/set
Throws:
GSimObjectException

getBehaviour

BehaviourIF getBehaviour()
                         throws GSimObjectException
Gets the behaviour associated with this agent.

Returns:
the behaviour
Throws:
GSimObjectException

getObjectListNames

java.lang.String[] getObjectListNames()
                                      throws GSimObjectException
Gets the names of all object lists that are defined for this agent.

Returns:
object list names
Throws:
GSimObjectException

getObjectListType

ObjectClassIF getObjectListType(java.lang.String listName)
                                throws GSimObjectException
Gets the type of object for a particular list.

Parameters:
listName -
Returns:
object class
Throws:
GSimObjectException

getObjects

ObjectClassIF[] getObjects(java.lang.String list)
                           throws GSimObjectException
Gets the default objects in a list. This object classes would be used as a template during the instanciation process.

Parameters:
list - the name of the object list
Returns:
a list of object classes
Throws:
GSimObjectException

isDeclaredObject

boolean isDeclaredObject(java.lang.String list,
                         java.lang.String objectName)
                         throws GSimObjectException
Tests whether an object class was defined in this agent, or whether it was defined somewhere up in the inheritance hierarchy.

Parameters:
list - the list name
objectName - the object class name
Returns:
true if the object was declared in the frame representing this agent, false otherwise
Throws:
GSimObjectException

removeObject

void removeObject(java.lang.String list,
                  ObjectClassIF object)
                  throws GSimObjectException
Removes an object class from a list.

Parameters:
list - the name of the list
object - the object class
Throws:
GSimObjectException

removeObject

void removeObject(java.lang.String list,
                  java.lang.String objectName)
                  throws GSimObjectException
Removes an object class, identified by name only, from a list.

Parameters:
list - the name of the list
objectName - the name of the object class
Throws:
GSimObjectException

resolveName

java.lang.Object resolveName(java.lang.String path)
                             throws GSimObjectException
Resolves a path into the object it references. Each object can be described by a name that represents its position within the object hierachy. For example the attribute attr of object obj in list list is given by list/obj/attr

Specified by:
resolveName in interface ObjectClassIF
Parameters:
path - the path
Returns:
Object an Attribute if the name specified an attribute; an ObjectClass if it specified an ObjectClass; a List of attributes if an attribute list was specified; a List of ObjectClasses if an object-list was specified; or null if the path did not specify a valid object/attribute/list.
Throws:
GSimObjectException

setBehaviour

void setBehaviour(BehaviourIF behaviour)
                  throws GSimObjectException
Sets the behaviour of this agent.

Parameters:
behaviour - the behaviour
Throws:
GSimObjectException

toUnit

gsim.def.objects.Unit toUnit()
This method returns the underlying entity (Frame or Instance).

Returns:
unit