java.lang.Object
- All Implemented Interfaces:
Cloneable
Factory for simulation objects providing functions.
Unlike most named-object factories, the values passed
as the final argument to 'set' methods can be cast to
the type Object, either explicitly or due to variable
assignment or the return value of a some method. This
flexibility is provided so that the value of the "object"
parameter can be an instance of
RealValuedFunctionTwo
or
some object defined in a scripting language.
The parameters this class supports are the following:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.obnaming.NamedObjectFactory
NamedObjectFactory.ConfigException, NamedObjectFactory.IndexedSetter, NamedObjectFactory.ParmNameIterator
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for service provider.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all entries and restore to default values.protected void
initObject
(SimFunctionTwo simFunction) Initialize an object.protected final SimFunctionTwo
Construct a new object.void
Set a value provided as a 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, 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
-
SimFunctionTwoFactory
Constructor.- Parameters:
sim
- the simulation used to name objects.
-
SimFunctionTwoFactory
public SimFunctionTwoFactory()Constructor for service provider. This constructor should not be used directly. It is necessary because of the introduction of modules in Java 9, and is used by a service provider that allows factories to be listed, possibly with documentation regarding their parameters. It just calls the default constructor with a null argument.
-
-
Method Details
-
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.- Overrides:
clear
in classSimObjectFactory<DefaultSimObjectFactory<SimFunctionTwo>,
Simulation, SimFunctionTwo>
-
set
Set a value provided as a object. This customizes the factory for the "object" parameter.- Parameters:
name
- the name of the entryvalue
- the value of the object- Throws:
NamedObjectFactory.ConfigException
- an exception encapsulating an IllegalArgumentException if an argument is out of bounds or the name does not match a parameter; an UnsupportedOperationException if the factory does not allow this method to be used; an IllegalStateException if the factory is not in a state for which this value may be parsed and entered;
-
newObject
Description copied from class:NamedObjectFactory
Construct a new object. The object will not be initialized. This method is called bycreateObject()
andcreateObjects
unless these methods are overridden. Subclasses should callwillIntern()
to determine if the object will interned or not, andgetObjectNamer()
to find the object namer. Some subclasses (e.g., org.devqsim.SimObjectFactory) provide a method that will return the object namer cast to the type needed by constructors. In the case of SimObjectFactory, this method is named getSimulation(). For a subclass of SimObjectFactory to create a new object of typeFoo
,newObject
will execute the expression
or an equivalent expression, wherenew Foo(getSimulation(), name, willIntern())
name
is the argument passed tonewObject
.- Specified by:
newObject
in classNamedObjectFactory<DefaultSimObjectFactory<SimFunctionTwo>,
Simulation, SimObject, SimFunctionTwo> - Parameters:
name
- the name of the object to be created- Returns:
- the new object
- See Also:
-
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);
".- Overrides:
initObject
in classSimObjectFactory<DefaultSimObjectFactory<SimFunctionTwo>,
Simulation, SimFunctionTwo> - Parameters:
simFunction
- the object to initialize
-