Module org.bzdev.drama
Package org.bzdev.drama.generic
Class GenericDomainFactory<OF extends GenericDomainFactory<OF,S,A,C,D,DM,F,G,Obj>,S extends GenericSimulation<S,A,C,D,DM,F,G>,A extends GenericActor<S,A,C,D,DM,F,G>,C extends GenericCondition<S,A,C,D,DM,F,G>,D extends GenericDomain<S,A,C,D,DM,F,G>,DM extends GenericDomainMember<S,A,C,D,DM,F,G>,F extends GenericFactory<S,A,C,D,DM,F,G>,G extends GenericGroup<S,A,C,D,DM,F,G>,Obj extends D>
java.lang.Object
org.bzdev.obnaming.NamedObjectFactory<F,Simulation,SimObject,OBJ>
org.bzdev.devqsim.SimObjectFactory<OF,S,Obj>
org.bzdev.drama.generic.GenericDomainFactory<OF,S,A,C,D,DM,F,G,Obj>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AbstractDomainFactory
public abstract class GenericDomainFactory<OF extends GenericDomainFactory<OF,S,A,C,D,DM,F,G,Obj>,S extends GenericSimulation<S,A,C,D,DM,F,G>,A extends GenericActor<S,A,C,D,DM,F,G>,C extends GenericCondition<S,A,C,D,DM,F,G>,D extends GenericDomain<S,A,C,D,DM,F,G>,DM extends GenericDomainMember<S,A,C,D,DM,F,G>,F extends GenericFactory<S,A,C,D,DM,F,G>,G extends GenericGroup<S,A,C,D,DM,F,G>,Obj extends D>
extends SimObjectFactory<OF,S,Obj>
Abstract class for domain factories.
Generally, there will be a class hierarchy of abstract factories matching the class hierarchy for subclasses of the class a factory creates, each responsible for providing parameters for the corresponding subclass. In addition, there will typically be a factory that is not abstract for each class that can be created.
This class includes the common parameters necessary to initialize domains.
Parameters:
-
priority
. The domain's priority level. -
parent
. The domain's parent domain. -
communicationDomainType
. The name of a communication domain type when no parent is provided. -
additionalCommDomainType
One of the additional communication domain types, represented as a string. Multiple types are allowed. -
condition
. One of the conditions associated with a domain. Multiple conditions are allowed. -
msgForwardingInfo
. An instance ofGenericMsgFrwdngInfo
used to control message forwarding for communication domains.
The parameters inherited from superclasses are:
- "timeline" - an integer-keyed set of values that define
changes in the object's configuration. Subclasses may provide
additional parameters. The default parameters are:
- "timeline.time" - the time at which timeline parameters are to change. This parameter must be provided if a timeline entry exists. The units are those used by the double-precision time unit for the simulation (for animations, this is generally seconds).
- "timeline.traceSetMode" - indicates how the parameter
"timeline.traceSets" is interpreted. the values are
enumeration constants of type
TraceSetMode
and are used as follows:-
KEEP
- keep the existing trace sets, adding additional ones specified by the parameter "timeline.traceSets". -
REMOVE
- remove the trace sets specified by the parameter "timeline.traceSets". -
REPLACE
- remove all existing trace sets and replace those with the ones specified by the timeline.traceSets parameter.
-
- "timeline.traceSets" - a parameter representing a set of TraceSet objects (the three-argument 'add' method is used to add entries).
- "traceSets" - a set of TraceSets a SimObject will use for tracing. One should use the add and remove factory methods as this parameter refers to a set of values.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.obnaming.NamedObjectFactory
NamedObjectFactory.ConfigException, NamedObjectFactory.IndexedSetter, NamedObjectFactory.ParmNameIterator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all entries and restore to default values.Get the set of conditions associated with this domain factoryGet the parent domain.int
Get the priority.protected final void
initConditionParm
(Class<C> condClass) Initialize the "condition" parameter.protected void
initObject
(Obj object) Initialize an object.Methods inherited from class org.bzdev.devqsim.SimObjectFactory
addToTimelineRequest, addToTimelineResponse, getSimulation
Methods inherited from class org.bzdev.obnaming.NamedObjectFactory
add, add, add, add, add, add, add, add, addDocResourceBundle, addDocResourceBundle, addJDoc, addJDoc, addLabelResourceBundle, addLabelResourceBundle, addTipResourceBundle, addTipResourceBundle, arrayInit, canAdd3, clear, configure, configureSupported, containsParm, createObject, createObject, createObject, createObject, createObjects, createObjects, createObjects, createObjects, createObjects, createObjects, doAfterInits, endObjectCreation, getDoc, getFactoryClass, getGLB, getLabel, getLayoutResource, getListedFactories, getLUB, getNextName, getNextNameIndex, getObjectNamer, getParmKeyType, getParmPrefix, getRVMode, getTemplateKeyMap, getTemplateKeyMapForFactories, getTemplateKeyMapForFactories, getTemplateKeyMapForFactories, getTip, getType, glbInRange, initParm, initParms, initParms, isClearOnly, isNamedObject, isRandomVariable, keyType, lubInRange, mustAdd, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newConfigExceptionInstance, newInstance, newInstance, newObject, parmNames, parmNameSet, parmPrefixes, remove, remove, remove, remove, remove, remove, remove, remove, removeParm, removeParms, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setDocAPIBase, setInterned, setLayoutResource, setLayoutResource, setNameRoot, setTarget, startObjectCreation, unset, unset, unset, unset, unset, unset, willIntern
-
Constructor Details
-
GenericDomainFactory
Constructor. Subclasses must call this constructor.- Parameters:
sim
- the simulation
-
-
Method Details
-
getPriority
public int getPriority()Get the priority.- Returns:
- the priority
-
getConditionSet
Get the set of conditions associated with this domain factory- Returns:
- a set of conditions
-
getParent
Get the parent domain.- Returns:
- the parent domain
-
initConditionParm
Initialize the "condition" parameter. This should be called by the first subclass for which the type parameter C is an actual type. The call should appear in the constructor immediately after "super" is called. This will set up a table of conditions that will be added to a domain. This method must be called only once, and is called by org.bzdev.drama.AbstractDomainFactory.- Parameters:
condClass
- the actual class corresponding to the type parameter C
-
clear
public void clear()Description copied from class:NamedObjectFactory
Clear all entries and restore to default values. Note: each subclass that implements this method should callsuper.clear()
. Any subclass that defines parameters should call this method in order to restore the parameters to their default values. When an annotation processor is used for some parameters, those parameters can be restored to their default value by calling the parm manager's setDefaults method with the factory as its argument. -
initObject
Description copied from class:NamedObjectFactory
Initialize an object. This method will call the methods for the object necessary to initialize it based on how the factory was configured, and is called bycreateObject()
andcreateObjects
unless these methods are overridden. The default method does nothing. Subclasses that override this method to provide subclass-specific initializations must start with the statement "super.initObject(object);
".
-