gov.nasa.arc.brahms.vm.api.common
Interface IClass

All Superinterfaces:
IActiveClass, IActiveConcept, IConcept, IType, IUserDefinedType

public interface IClass
extends IActiveClass

The concept of a 'class' in Brahms is similar to the concept of a template or class in object-oriented programming. It defines the activities (workframes), initial-facts and initial-beliefs for instances of that class (i.e. 'objects'). Classes are used to define inanimate artifacts, such as phones, faxes, computer systems, pieces of paper, etc.

Version:
$Revision: 1.1 $ $Date: 2009/11/23 18:38:32 $ $Author: rnado $
Author:
Ron van Hoof

Field Summary
 
Fields inherited from interface gov.nasa.arc.brahms.vm.api.common.IUserDefinedType
UDT
 
Method Summary
 java.util.List<IObject> getInstances(boolean includeSubClasses)
          Returns a list of all of this class' instances.
 IObject newInstance(java.lang.String name, IContext actionCtx)
          newInstance creates a new instance of this class and returns the new instance.
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IActiveConcept
hasThoughtframes, hasWorkframes
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IConcept
getAttribute, getAttributes, getRelation, getRelations, isLocal
 
Methods inherited from interface gov.nasa.arc.brahms.vm.api.common.IType
getName, getType
 

Method Detail

newInstance

IObject newInstance(java.lang.String name,
                    IContext actionCtx)
                    throws ExternalException
newInstance creates a new instance of this class and returns the new instance. The new instance is given the specified name. If the name already exists a unique number will be attached to the name.

Parameters:
name - the name of the new instance
actionCtx - the IContext for the action
Returns:
IObject the new instance of this class
Throws:
ExternalException - if the creation of the new instance fails

getInstances

java.util.List<IObject> getInstances(boolean includeSubClasses)
                                     throws ExternalException
Returns a list of all of this class' instances. If includeSubClasses is set to true it will also include all the instances of this class' sub classes.

Parameters:
includeSubClasses - true to include instances of sub classes, false to only return direct instances of this class
Returns:
List the list of instances, an empty list if there are none
Throws:
ExternalException - if an internal error occurs


Copyright © 1997-2012 All Rights Reserved.