Class NamedObjectFactory<F extends NamedObjectFactory<F,NMR,NMD,OBJ>,NMR extends ObjectNamerOps<NMD>,NMD extends NamedObjectOps,OBJ extends NMD>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
DefaultNOFactory
,SimObjectFactory
ScriptingContext
. For the Javascript
(EMCAScript) case, the object used to configure the factory is
either a Javascript object or a Javascript array that is passed to
a factory method named "configure". For an array,
each element is processed in order. For a Javascript object, which
is a collection of attribute-value pairs, the names of the attribute
correspond to the parameter names used in set or add methods. There
are several reserved names and these are treated specially. The
reserved attribute names are
- "withKey" - the value is the name of a set/add key. In this case, the key is used by the current object and any nested objects (objects indicated by a "config" attribute). A "withIndex" attribute is not allowed.
- "withIndex " - The value of this parameter is a Javascript array. The attribute "withKey" is not allowed.
- "withPrefix " - a prefix is defined. For the value of "config" or each element of the value of "withIndex", each non-reserved attribute name NAME is replaced with PREFIX.NAME, where PREFIX is the value of the "prefix" attribute. If other "withPrefix" attributes are available due to nesting, all of them are concatenated (outer first), with a period separating them.
- "config" - this indicates that a nested object or array of objects should be used as well. Nested objects inherit "withKey" and "withPrefix" attributes.
is equivalent tofactory.configure({foo: 10, bar: 20})
The following codefactory.set("foo", 10); factory.set("bar", 20);
is equivalent tofactory.configure({withPrefix: "timeline", withKey: "b", config: {foo: 10, bar: 20}});
The following codefactory.set("timeline.foo", "b", 10); factory.set("timeline.bar", "b", 20);
is equivalent tofactory.configure({withPrefix: "timeline", withIndex: [{foo: 10}, {foo: 20}]);
The following codefactory.set("timeline.foo", 0, 10); factory.set("timeline.foo", 1, 20);
is simply a shorthand notation forfactory.configure({withPrefix: "timeline", withIndex: [{foo: 10}, {foo: 20}]
If the factory has a parameter "foobar" that represents a set of integers, the codefactory.configure([{withKey 0, config: {"timeline.foo": 10}}, {withKey 1, config: {"timeline.bar": 20}}]);
can be used. This is equivalent tofactory.configure({foobar: [10, 20, 30]});
factory.add("foobar", 10); factory.add("foobar", 20); factory.add("foobar", 30);
Each supported scripting language will use a syntax appropriate to it. Python uses essentially the same syntax, but all the attribute names must be quoted.
To simplify the creation of a large number of objects in which some parameters may differ, a factory can be written to make use of random variables. In this case, one can provide the factory with either a primitive value (int, long, double, or boolean) or a corresponding random variable, which will be used to obtain a separate value for each object created.
Factories are defined by a set of named parameters. An array of Parm objects and/or a ParmManager defines the parameters, and usually the array or ParmManager is passed to initParms in a constructor for each class in a class hierarchy that defines some of a factory's parameters. If multiple arrays and ParmManager objects are used, each requires a separate call to initParms. For each Parm, there will typically be a corresponding field to hold its value. This is set or cleared (clearing may mean restoring a default value) by using an anonymous class that overrides the appropriate ParmParser methods. When a ParmManager is used, it will typically have been created by a Java annotation processor, using the following annotations:
- FactoryParmManager. This annotation applies to a factory's class definition and indicates the name of a ParmManager for the factory to use.
- PrimitiveParm. This annotation applies to fields defined by a factory, and provides data needed to generate a Parm instance. The fields are simple types: int or Integer, long or Long, boolean or Boolean, double or Double, String, any enumeration, a named object (which implements NamedObjectOps), or a set of the above.
- KeyedPrimitiveParm: a table with a key that may be an integer, long, String, or named object and a value suitable for a a primitive parameter. The corresponding object must be an implementation of java.util.Map.
- CompoundParmType. This annotation applies to a class that will be used to define a parameter with a compound name. The parameters the annotated class defines must be primitive parameters.
- CompoundParm. This defines a parameter whose value is an instance of a class annotated by CompoundParmType and that will be used as the first component of compound parameters whose second components are the names of primitive parameters that a CompoundParmType's class define.
- KeyedCompoundParms provide the same keys as a KeyedPrimitiveParm but the value type of the map is a class annotated by CompoundParmType.
would be appropriate for a factory for a subclass of some object defined in the@FactoryParmManager(value="AbstractFooFactoryPM") public abstract class AbstractFooFactory<OBJ extends Foo> { ... AbstractFooFactory<OBJ> pm; public AbstractFooFactory(Animation2D a2d) { pm = new AbstractFooFactoryPM<OBJ>(this); initParms(pm, AbstractFooFactory.class); } }
anim2d
package --- the class created by the
annotation processor is defined as follows:
If the type for the ParmManager is not expressed exactly as shown above, type-erasure issues will cause a compile-time error.class AbstractFooFactoryPM<OBJ extends Foo> extends ParmManager<AbstractFooFactory<Obj>> { ... }
A factory that is not an abstract class must implement the method newObject, which takes a string as an argument. Abstract factories should not implement this method. Any factory may implement the following methods to initialize named objects (shown in the order in which they will be called):
- startObjectCreation(): called at the start of a sequence of operations to create one or more objects. The method newObject will be called after this method has been called.
- initObject(OBJ): called to initialize an object after it has been created.
- arrayInit(T[],int,int) where T is a type parameter: called once when an array of objects has been created and initObject has been called for each of those objects.
- doAfterInits(OBJ): called for each object being created after initObject and possibly arrayInit has been called.
- endObjectCreation(): called at the end of a sequence of operations to create one or more objects.
Generally a factory should implement the method clear(), which is should start by calling super.clear(). The rest of this method should clear the existing fields by restoring them to their default values. As a convenience, when a parm manager is used, each parm manager provides a method name setDefaults that takes the current factory as its argument. Calling the setDefaults method will automatically reset the fields associated with parameters defined via annotations for the current class.
Any subclass that overrides an "add" or "set" method defined by this
class is expected to indicate an error by throwing an instance of
NamedObjectFactory.ConfigException
, and
can generate this exception by using methods named
newConfigExceptionInstance:
newConfigExceptionInstance
(String, IllegalStateException).newConfigExceptionInstance
(String, UnsupportedOperationException).newConfigExceptionInstance
(String, Object, IllegalArgumentException).newConfigExceptionInstance
(String, Object, IllegalStateException).newConfigExceptionInstance
(String, Object, UnsupportedOperationException).newConfigExceptionInstance
(String, Object, IndexOutOfBoundsException).
NamedObjectFactory.ConfigException
specially.
Finally, all factories that are not abstract should be listed in a file name META-INF/services/org.bzdev.obnaming.NamedObjectFactory that should be included in the same JAR file as the factory to facilitate locating factories and listing them.
Note: when used with a security manager, this class needs the runtime permission getClassLoader due to using ResourceBundle.getBundle methods that take a class loader as an argument.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Configuration exception.static interface
Interface for classes that can set the values for multiple indexed factory parameters.static class
Iterator returned by the factory method parmNames(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a value provided as a double to a set of integers.void
Add a value provided as an int to a set of integers.void
Add a value provided as a long to a set of integers.void
Add a value provided as an enumeration to a set of enumerations.void
Add a value provided as an array of objects representing a compound key.void
Add a compound key provided as two objects.void
Add a value provided as a string to as set of strings.void
add
(String name, NamedObjectOps value) Add a value provided as a named object to a set of named objects.protected void
addDocResourceBundle
(String baseName, Class clazz) Add a resource bundle for docs associated with configuration entries.protected void
addDocResourceBundle
(String keyPrefix, String delimiter, String baseName, Class clazz) Add a resource bundle for docs associated with compound configuration entries.static void
Indicate that a URL refers to an Javadoc API directory.static void
Indicate that a URL refers to an Javadoc API directory.protected void
addLabelResourceBundle
(String baseName, Class clazz) Add a resource bundle for labels associated with configuration parameters.protected void
addLabelResourceBundle
(String keyPrefix, String delimiter, String baseName, Class clazz) Add a resource bundle for labels associated with keyed configuration parameters.protected void
addTipResourceBundle
(String baseName, Class clazz) Add a resource bundle for tips associated with configuration entries.protected void
addTipResourceBundle
(String keyPrefix, String delimiter, String baseName, Class clazz) Add a resource bundle for tips associated with compound configuration entries.protected <T> void
arrayInit
(T[] array, int offset, int n) Apply additional initializations after an array of objects has been created and each initialized by callinginitObject(obj)
.boolean
Test if a the three-argument form of add can be used.void
clear()
Clear all entries and restore to default values.void
Clear keys by removing all keys associated with a parameter name or restore a parameter to its default value.void
Configure a factory.boolean
Determine if the configure method is supported by this factory's object namer.boolean
containsParm
(String name) Determine if a parameter name exists.Create a named object of the type this factory supports with the object's name generated by the factory.createObject
(String name) Create a named object of the type this factory supports.createObject
(String name, boolean clearConfig, Object scriptObject) Create a named object of the type this factory supports, setting or modifying the factory configuration.createObject
(String name, Object scriptObject) Create a named object of the type this factory supports, modifying the factory configuration.<T> T[]
createObjects
(T[] array) Create named objects with the names generated by the factory and the number of objects determined by an array size.<T> T[]
createObjects
(T[] array, int n) Create named objects with the names generated by the factory.<T> T[]
createObjects
(T[] array, int offset, int n) Create named objects given an offset with the names generated by the factory.<T> T[]
createObjects
(T[] array, String root) Create named objects with the number of objects determined by an array.<T> T[]
createObjects
(T[] array, String root, int n) Create named objects.<T> T[]
createObjects
(T[] array, String root, int offset, int n) Create named objects.protected void
doAfterInits
(OBJ object) Final initialization code.protected void
End a sequence of creation of new objects.Get a doc.Class<?>
getFactoryClass
(String name) Get the class for the factory that defined a parameter nameGet the GLB (Greatest Lower Bound) for the allowed range of values.Get a label.Return the name of the resource specifying how a GUI should configure this factory.static Set<NamedObjectFactory>
getListedFactories
(String pattern) Get a set of factories that are factory-listing service providers, restricted to those factories whose fully-qualified class names match a pattern.Get the LUB (Least Upper Bound) for the allowed range of values.protected String
Generate a named-object name.protected long
Generate a unique index to append to a string to generate a name.Get the factory's object namer.getParmKeyType
(String name) Get the parameter-key-type data for a parameter.getParmPrefix
(String parmName) Get a parameter prefix of a compound parameter given the parameter name.boolean
Get the random-variable mode.Get a template-processor key map for a factory's parameters.static TemplateProcessor.KeyMap
Get a key map for listing the parameters for all factories specified as factory-listing service providers.static TemplateProcessor.KeyMap
getTemplateKeyMapForFactories
(String pattern) Get a key map for listing the parameters for all factories specified as factory-listing service providers, restricted to those factories whose fully-qualified class names match a pattern.static TemplateProcessor.KeyMap
getTemplateKeyMapForFactories
(Set<NamedObjectFactory> factories) Get a template key map for a set of factories.Get a tip.Class<?>
Determine the type of a parameter's value.boolean
glbInRange
(String name) Determine if the GLB (Greatest Lower Bound) for the range of allowed values is in that set.protected void
initObject
(OBJ object) Initialize an object.protected void
Initialize parameters table by adding a single parameter.protected void
Initialize parameters table.protected void
initParms
(ParmManager<? extends F> manager, Class<?> clazz) Initialize parameters specified by a ParmManager.boolean
isClearOnly
(String name) Determine if a parameter is a clear-only parameter.boolean
isNamedObject
(Object obj) Determine if an object is an instance of a named object.boolean
isRandomVariable
(Object obj) Determine if an object is an instance of RandomVariable<?>.Class<?>
Determine the type of a key, if any.boolean
lubInRange
(String name) Determine if the LUB (Least Upper Bound) for the range of allowed values is in that set.boolean
Test if a name must be added rather than set.protected NamedObjectFactory.ConfigException
Create a ConfigException without a key for an IllegalArgumentException.protected NamedObjectFactory.ConfigException
Create a ConfigException without a key for an IllegalStateException.protected NamedObjectFactory.ConfigException
newConfigExceptionInstance
(String name, Object key, IllegalArgumentException e) Create a ConfigException with a key for an IllegalArgumentException.protected NamedObjectFactory.ConfigException
newConfigExceptionInstance
(String name, Object key, IllegalStateException e) Create a ConfigException with a key for an IllegalStateException.protected static NamedObjectFactory.ConfigException
newConfigExceptionInstance
(String name, Object key, IndexOutOfBoundsException e) Create a ConfigException with a key for an IndexOutOfBoundsException.protected NamedObjectFactory.ConfigException
newConfigExceptionInstance
(String name, Object key, UnsupportedOperationException e) Create a ConfigException with a key for an UnsuportedOperationException.protected NamedObjectFactory.ConfigException
Create a ConfigException without a key for an UnsupportedOperationException.static NamedObjectFactory
newInstance
(ObjectNamerOps namer, Class clazz) Create a new instance of a NamedObjectFactory given a factory class.static NamedObjectFactory
newInstance
(ObjectNamerOps namer, String className) Create a new instance of a NamedObjectFactory given a factory class name.protected abstract OBJ
Construct a new object.Get the names of parameters.Get a set of the names of entries.Return a set of prefixes used in compound parameters.void
Remove a value provided as a double from a set of integers.void
Remove an entry with an index from a set of integers.void
Remove a value provided as a long from a set of integers.void
Remove an entry with an enumeration key from a set of enumerations.void
Remove an entry with a compound key, undoing the corresponding add operation.void
Remove a compound key provided as two objects, undoing the corresponding add operation.void
Remove an entry with a key from a set of strings.void
remove
(String name, NamedObjectOps key) Remove an entry with a named-object key from a set of named objects.protected void
removeParm
(String name) Remove a single parameter that was previously named.protected void
removeParms
(String[] parmNames) Remove parameters previously named.void
Set a value provided as a boolean.void
Set a value provided as a double.void
Set a value provided as an int.void
Set a value provided as a boolean, given an index.void
Set a value provided as a double, given an index.void
Set a value provided as an int, given an index.void
Set a value provided as a long, given an index.void
Set a value provided as an enumeration type, given an index.void
Set a value provided as a string, given an index.void
set
(String name, int index, BooleanRandomVariable value) Set a value provided as an boolean-valued random variable, given an index.void
set
(String name, int index, BooleanRandomVariableRV value) Set a value provided as an boolean-random-variable-valued random variable, given an index.void
set
(String name, int index, DoubleRandomVariable value) Set a value provided as an double-valued random variable, given an index.void
set
(String name, int index, DoubleRandomVariableRV value) Set a value provided as an double-random-variable-valued random variable, given an index.void
set
(String name, int index, IntegerRandomVariable value) Set a value provided as an integer-valued random variable, given an index.void
set
(String name, int index, IntegerRandomVariableRV value) Set a value provided as an integer-random-variable-valued random variable, given an index.void
set
(String name, int index, LongRandomVariable value) Set a value provided as an long-valued random variable, given an index.void
set
(String name, int index, LongRandomVariableRV value) Set a value provided as an long-random-variable-valued random variable, given an index.void
set
(String name, int index, NamedObjectOps value) Set a value provided as a named object, given an index.void
Set a value provided as a long.void
Set a value provided as an enumeration type.void
Set a value provided as a boolean, given an enumeration key.void
Set a value provided as a double, given an enumeration key.void
Set a value provided as an int, given an enumeration key.void
Set a value provided as a long, given an enumeration key.void
Set a value provided as an enumeration type, given an enumeration key.void
Set a value provided as a string, given an enumeration key.void
set
(String name, Enum<?> key, BooleanRandomVariable value) Set a value provided as an boolean-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, BooleanRandomVariableRV value) Set a value provided as an boolean-random-variable-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, DoubleRandomVariable value) Set a value provided as an double-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, DoubleRandomVariableRV value) Set a value provided as an double-random-variable-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, IntegerRandomVariable value) Set a value provided as an integer-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, IntegerRandomVariableRV value) Set a value provided as an integer-random-variable-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, LongRandomVariable value) Set a value provided as an long-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, LongRandomVariableRV value) Set a value provided as an long-random-variable-valued random variable, given an enumeration key.void
set
(String name, Enum<?> key, NamedObjectOps value) Set a value provided as a named object, given an enumeration key.void
Set a value provided as a boolean, given a compound key.void
Set a value provided as a double, given a compound key.void
Set a value provided as an int, given a compound key.void
Set a value provided as a long, given a compound key.void
Set a value provided as an enumeration type, given a compound key.void
Set a value provided as a string, given a compound key.void
set
(String name, Object[] key, BooleanRandomVariable value) Set a value provided as an boolean-valued random variable, given a compound key.void
set
(String name, Object[] key, BooleanRandomVariableRV value) Set a value provided as an boolean-random-variable-valued random variable, given a compound key.void
set
(String name, Object[] key, DoubleRandomVariable value) Set a value provided as an double-valued random variable, given a compound key.void
set
(String name, Object[] key, DoubleRandomVariableRV value) Set a value provided as an double-random-variable-valued random variable, given a compound key.void
set
(String name, Object[] key, IntegerRandomVariable value) Set a value provided as an integer-valued random variable, given a compound key.void
set
(String name, Object[] key, IntegerRandomVariableRV value) Set a value provided as an integer-random-variable-valued random variable, given a compound key.void
set
(String name, Object[] key, LongRandomVariable value) Set a value provided as an long-valued random variable, given a compound key.void
set
(String name, Object[] key, LongRandomVariableRV value) Set a value provided as an long-random-variable-valued random variable, given a compound key.void
set
(String name, Object[] key, NamedObjectOps value) Set a value provided as a named object, given a compound key.void
Set a value provided as a string.void
Set a value provided as a boolean, given a key.void
Set a value provided as a double, given a key.void
Set a value provided as an int, given a key.void
Set a value provided as a long, given a key.void
Set a value provided as an enumeration, given a key.void
Set a value provided as a string, given a key.void
set
(String name, String key, BooleanRandomVariable value) Set a value provided as a boolean-valued random variable, given a key.void
set
(String name, String key, BooleanRandomVariableRV value) Set a value provided as a boolean-random-variable-valued random variable, given a key.void
set
(String name, String key, DoubleRandomVariable value) Set a value provided as a double-valued random variable, given a key.void
set
(String name, String key, DoubleRandomVariableRV value) Set a value provided as a double-random-variable-valued random variable, given a key.void
set
(String name, String key, IntegerRandomVariable value) Set a value provided as an integer-valued random variable, given a key.void
set
(String name, String key, IntegerRandomVariableRV value) Set a value provided as an integer-random-variable-valued random variable, given a key.void
set
(String name, String key, LongRandomVariable value) Set a value provided as a long-valued random variable, given a key.void
set
(String name, String key, LongRandomVariableRV value) Set a value provided as a long-random-variable-valued random variable, given a key.void
set
(String name, String key, NamedObjectOps value) Set a value provided as a named object, given a key.void
set
(String name, BooleanRandomVariable value) Set a value provided as an boolean-valued random variable.void
set
(String name, BooleanRandomVariableRV value) Set a value provided as an boolean-random-variable-valued random variable.void
set
(String name, DoubleRandomVariable value) Set a value provided as a double-valued random variable.void
set
(String name, DoubleRandomVariableRV value) Set a value provided as a double-random-variable-valued random variable.void
set
(String name, IntegerRandomVariable value) Set a value provided as an integer-valued random variable.void
set
(String name, IntegerRandomVariableRV value) Set a value provided as an integer-random-variable-valued random variable.void
set
(String name, LongRandomVariable value) Set a value provided as an long-valued random variable.void
set
(String name, LongRandomVariableRV value) Set a value provided as a long-random-variable-valued random variable.void
set
(String name, NamedObjectOps value) Set a value provided as a named object.void
set
(String name, NamedObjectOps key, boolean value) Set a value provided as a boolean, given a named-object key.void
set
(String name, NamedObjectOps key, double value) Set a value provided as a double, given a named-object key.void
set
(String name, NamedObjectOps key, int value) Set a value provided as an int, given a named-object key.void
set
(String name, NamedObjectOps key, long value) Set a value provided as a long, given a named-object key.void
set
(String name, NamedObjectOps key, Enum<?> value) Set a value provided as an enumeration type, given a named-object key.void
set
(String name, NamedObjectOps key, String value) Set a value provided as a string, given a named-object key.void
set
(String name, NamedObjectOps key, BooleanRandomVariable value) Set a value provided as an boolean-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, BooleanRandomVariableRV value) Set a value provided as an boolean-random-variable-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, DoubleRandomVariable value) Set a value provided as an double-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, DoubleRandomVariableRV value) Set a value provided as an double-random-variable-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, IntegerRandomVariable value) Set a value provided as an integer-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, IntegerRandomVariableRV value) Set a value provided as an integer-random-variable-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, LongRandomVariable value) Set a value provided as an long-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, LongRandomVariableRV value) Set a value provided as an long-random-variable-valued random variable, given a named-object key.void
set
(String name, NamedObjectOps key, NamedObjectOps value) Set a value provided as a named object, given a named-object key.static void
setDocAPIBase
(URL url) Set the base URL.void
setInterned
(boolean value) Specify if objects created will be interned.protected void
setLayoutResource
(Class<?> clazz, String extension) Set the name of a resource specifying how a GUI should configure this factory given its class.protected void
setLayoutResource
(String resource) Set the name of a resource specifying how a GUI should configure this factory.void
setNameRoot
(String nameRoot) Set the initial part of a name to use when creating objects.static void
Set the target to use in an HTML <A> element.protected void
Start a sequence of creation of new objects.void
Clear an entry and restore it to the default value.void
Unset an entry with an index and restore it to the default value.void
Unset an entry with an enumeration key and restore it to the default value.void
Unset an entry with a compound key and restore it to the default value.void
Unset an entry with a key and restore it to the default value.void
unset
(String name, NamedObjectOps key) Unset an entry with a named-object key and restore it to the default value.boolean
Determine if a created object will be interned.
-
Constructor Details
-
NamedObjectFactory
Constructor. Subclasses must call this constructor. If the object namer is null, the factory will not be able to create objects, but can be queried to get parameters, etc.- Parameters:
namer
- the object namer
-
-
Method Details
-
newConfigExceptionInstance
protected NamedObjectFactory.ConfigException newConfigExceptionInstance(String name, IllegalArgumentException e) Create a ConfigException without a key for an IllegalArgumentException. Subclasses that override an "add" or "set" method (which should occur only in atypical cases) are expected to start with a 'try' statement that catches any IllegalArgumentException and throws an exception created with this method or the variant that specifies a key.- Parameters:
name
- the parameter name passed to an "add" or "set" methode
- the exception- Returns:
- the new exception
-
newConfigExceptionInstance
protected NamedObjectFactory.ConfigException newConfigExceptionInstance(String name, IllegalStateException e) Create a ConfigException without a key for an IllegalStateException. Subclasses that override an "add" or "set" method (which should occur only in atypical cases) are expected to start with a 'try' statement that catches any IllegalStateException and throws an exception created with this method or the variant that specifies a key.- Parameters:
name
- the parameter name passed to an "add" or "set" methode
- the exception- Returns:
- the new exception
-
newConfigExceptionInstance
protected NamedObjectFactory.ConfigException newConfigExceptionInstance(String name, UnsupportedOperationException e) Create a ConfigException without a key for an UnsupportedOperationException. Subclasses that override an "add" or "set" method (which should occur only in atypical cases) are expected to start with a 'try' statement that catches any UnsupportedOperationException and throws an exception created with this method or the variant that does not specify a key.- Parameters:
name
- the parameter name passed to an "add" or "set" methode
- the exception- Returns:
- the new exception
-
newConfigExceptionInstance
protected NamedObjectFactory.ConfigException newConfigExceptionInstance(String name, Object key, IllegalArgumentException e) Create a ConfigException with a key for an IllegalArgumentException. Subclasses that override an "add" or "set" method (which should occur only in atypical cases) are expected to start with a 'try' statement that catches any IllegalArgumentException and throws an exception created with this method or the variant that does not specify a key.- Parameters:
name
- the parameter name passed to an "add" or "set" methodkey
- the key or index passed to an 'add" or "set" methode
- the exception- Returns:
- the new exception
-
newConfigExceptionInstance
protected NamedObjectFactory.ConfigException newConfigExceptionInstance(String name, Object key, IllegalStateException e) Create a ConfigException with a key for an IllegalStateException. Subclasses that override an "add" or "set" method (which should occur only in atypical cases) are expected to start with a 'try' statement that catches any IllegalStateException and throws an exception created with this method or the variant that does not specify a key.- Parameters:
name
- the parameter name passed to an "add" or "set" methodkey
- the key or index passed to an 'add" or "set" methode
- the exception- Returns:
- the new exception
-
newConfigExceptionInstance
protected NamedObjectFactory.ConfigException newConfigExceptionInstance(String name, Object key, UnsupportedOperationException e) Create a ConfigException with a key for an UnsuportedOperationException. Subclasses that override an "add" or "set" method (which should occur only in atypical cases) are expected to start with a 'try' statement that catches any UnsupportedOperationException and throws an exception created with this method or the variant that does not specify a key.- Parameters:
name
- the parameter name passed to an "add" or "set" methodkey
- the key or index passed to an 'add" or "set" methode
- the exception- Returns:
- a new exception
-
newConfigExceptionInstance
protected static NamedObjectFactory.ConfigException newConfigExceptionInstance(String name, Object key, IndexOutOfBoundsException e) Create a ConfigException with a key for an IndexOutOfBoundsException. Subclasses that override an "add" or "set" method (which should occur only in atypical cases) are expected to start with a 'try' statement that catches any IndexOutOfBoundsException and throws an exception created with this method or the variant that does not specify a key.- Parameters:
name
- the parameter name passed to an "add" or "set" methodkey
- the key or index passed to an 'add" or "set" methode
- the exception- Returns:
- the new exception
-
containsParm
Determine if a parameter name exists.- Parameters:
name
- the name of the parameter- Returns:
- true if the parameter name exists; false otherwise
-
getObjectNamer
Get the factory's object namer.- Returns:
- the object namer
-
newInstance
public static NamedObjectFactory newInstance(ObjectNamerOps namer, String className) throws IllegalArgumentException Create a new instance of a NamedObjectFactory given a factory class name. The factory must have a single-argument constructor that takes its object namer as its argument.- Parameters:
namer
- the object namer for the factoryclassName
- the fully-qualified class name of a factory.- Returns:
- the new named object factory
- Throws:
IllegalArgumentException
- the factory is not listed in a META-INF/services/org.bzdev.NamedObjectFactory resource or the class name does not refer to subclass of NamedObjectFactory
-
newInstance
public static NamedObjectFactory newInstance(ObjectNamerOps namer, Class clazz) throws IllegalArgumentException Create a new instance of a NamedObjectFactory given a factory class. The factory must have a single-argument constructor that takes its object namer as its argument.- Parameters:
namer
- the object namer for the factoryclazz
- the factory's class- Returns:
- the new named object factory
- Throws:
IllegalArgumentException
- the factory is not listed in a META-INF/services/org.bzdev.NamedObjectFactory resource or the class name does not refer to subclass of NamedObjectFactory
-
getTemplateKeyMapForFactories
Get a key map for listing the parameters for all factories specified as factory-listing service providers. These factories must not be abstract classes, and must appear, one per line, in a file namedMETA-INF/services/org.bzdev.obnaming.NamedObjectFactory
The service provided is the ability to list factory parameters.The key map contains a single entry named "factories" whose value is a list, each element of which is a key map returned by calling
getTemplateKeyMap()
for a given factory.- Returns:
- the key map
- See Also:
-
getTemplateKeyMapForFactories
Get a key map for listing the parameters for all factories specified as factory-listing service providers, restricted to those factories whose fully-qualified class names match a pattern. The pattern is a regular expression in which a '*' indicates an arbitrary number of characters that do not include a period '.', where '|" indicates alternatives, and where a subexpression bracketed by '(' and ')' indicates grouping. Thus, the patternorg.bzdev.(anim2d|drama).*
will match all listed factories in the packages org.bzdev.anim2d and org.bzdev.drama. These factories must not be abstract classes, and must appear, one per line, in a file namedMETA-INF/services/org.bzdev.obnaming.NamedObjectFactory
and each entry in this file must be a subclass of NamedObjectFactory. The service provided is the ability to list factory parameters.The key map contains a single entry named "factories" whose value is a list, each element of which is a key map returned by calling
getTemplateKeyMap()
for a given factory.- Parameters:
pattern
- the search pattern- Returns:
- the key map
- See Also:
-
getTemplateKeyMapForFactories
public static TemplateProcessor.KeyMap getTemplateKeyMapForFactories(Set<NamedObjectFactory> factories) Get a template key map for a set of factories.- Parameters:
factories
- the set of factories- Returns:
- the key map
- See Also:
-
getListedFactories
Get a set of factories that are factory-listing service providers, restricted to those factories whose fully-qualified class names match a pattern. The pattern is a regular expression in which a '*' indicates an arbitrary number of characters that do not include a period '.', where '|" indicates alternatives, and where a subexpression bracketed by '(' and ')' indicates grouping. As a special case, '**' indicates any sequence of characters other than new lines (which never appear in a factory name), and must end the pattern when used. Thus, the patternorg.bzdev.(anim2d|drama).*
will match all listed factories in the packages org.bzdev.anim2d and org.bzdev.drama.* Similarly,org.bzdev.**
will match all factories whose fully qualified names start with "org.bzdev." These factories must not be abstract classes, and must appear, one per line, in a file namedMETA-INF/services/org.bzdev.obnaming.NamedObjectFactory
and each entry in this file must be a subclass of NamedObjectFactory. The service provided is the ability to list factory parameters.The key map contains a single entry named "factories" whose value is a list, each element of which is a key map returned by calling
getTemplateKeyMap()
for a given factory.- Parameters:
pattern
- the search pattern- Returns:
- a set of factories.
- See Also:
-
addJDoc
Indicate that a URL refers to an Javadoc API directory. The tables modified by this method are used by the methodgetTemplateKeyMap()
.- Parameters:
apiURL
- the URL- Throws:
IOException
- the operation failed.
-
addJDoc
Indicate that a URL refers to an Javadoc API directory. The argumentofflineURL
is used to read the the element-list or package-list files in an API directory, and is provided for cases where the URL specified byapiURL
either does not yet exist or is not currently accessible. The tables modified by this method are used by the methodgetTemplateKeyMap()
.- Parameters:
apiURL
- the URL for the Javadoc API directoryofflineURL
- the URL for an off-line copy of the Javadoc API directory- Throws:
IOException
- the operation failed.
-
setDocAPIBase
Set the base URL. The base URL is the common portion of a URL shared by multiple sets of API documentation. Typically, this will be used when documenation for multiple APIs all have a common parent directory. When possible, relative URLs will be used, simplyfing deployment on multiple servers. The value set by this method is used by the methodgetTemplateKeyMap()
.- Parameters:
url
- the base URL
-
setTarget
Set the target to use in an HTML <A> element. This field is used when a link should be displayed in a specified frame. The value set by this method is used by the methodgetTemplateKeyMap()
.- Parameters:
htmlTarget
- the target; null if there is none.
-
getTemplateKeyMap
Get a template-processor key map for a factory's parameters. The keymap contains the following entries:-
factory
- the fully qualified class name of the factory. -
factoryAPI
- the fully qualified class name of the factory wrapped by an <A> element that points to the Javadoc API documentation for the factory. The URL will begin with a base URL configured by the methodaddJDoc(java.net.URL)
. oraddJDoc(java.net.URL,java.net.URL)
. -
factoryDoc
the fully qualified class name of the factory wrapped by an <A> element that points to the parameter documentation for the factory. -
parameters
- a list of keymaps for the parameters used by the factory, each element of which contains the following:-
factory
- the fully qualified class name of a factory. -
factoryPackage
- the name of the package in which the factory is defined. -
nextPackageEntry
- this element is added by code in the lsnof command and is not available elsewhere. It provides a list entry giving the package name when that has changed from the previous entry. -
factoryAPI
- the HTML expression for a link to the API documentation (usually created by javadoc) for a factory. The fully-qualified class name will be displayed. The <A> element generated may include a target attribute. -
factoryDoc
- the HTML expression for a link to the factory documentation (usually created by lsnof). From a base url, the value will be the fully qualified class name for the factory with each '.' separating a package from the next component replaced with a '/' and with ".html" appended at the end. -
name
- the name of the parameter. -
label
- the parameter's label. -
definingFactoryClass
- the factory class in which the parameter is defined. -
type
- the type of the parameters (the string "(none)" if there is none) -
typeHTML
- the type of the parameters (the string "(none)" if there is none). When a URL to javadoc documentation for the class exists a link to that documentation will be provided by wrapping the name in an <A> element. This link refers to a location in the same document in which the link appears. -
rvmode
- the random-variable mode. -
keytype
- the type of a key (the string "(none)" if there is none). -
keytypeHTML
- the type of a key (the string "(none)" if there is none). When a URL to javadoc documentation for the class exists a link to that documentation will be provided by wrapping the name in an <A> element. -
range
- the range of values that the parameter will accept (an empty string if there is none). -
description
- a tool-tip description of the parameter. -
descriptionHTML
- a tool-tip description of the parameter in HTML. -
hasDoc
- a map that, when present, indicates that a doc entry exists. -
noDoc
- a map that, when present, indicates that a doc entry does not exist. -
doc
- the value provided by a doc resource bundle for the parameter. This must be an HTML fragment that can be placed between<DIV>
and</DIV>
.
description
anddescriptionHTML
cases, a starting<html>
and ending</html>
indicate that the text is formatted using HTML. In this case, any<br>
directives will be replaced with whitespace (a newline followed by two tabs). For HTML, the description will replace<JDOC>
with<CODE>
and</JDOC>
with</CODE>
. This is also true for the descriptionHTML case, but in that case the content of the JDOC element, which should be a fully-qualified class name optionally followed by a crosshatch ("#") and a fragment, will be changed into a link suitable to Javadoc documentation. The class name and fragment must follow the same conventions used by javadoc. -
- Returns:
- the template-processor key map for this factory
-
-
parmPrefixes
Return a set of prefixes used in compound parameters.- Returns:
- an unmodifiable set of prefixes
-
getParmPrefix
Get a parameter prefix of a compound parameter given the parameter name.- Parameters:
parmName
- the name of the parameter- Returns:
- the parameter's prefix; null if it is not a compound parameter.
-
addLabelResourceBundle
protected void addLabelResourceBundle(String baseName, Class clazz) throws NullPointerException, MissingResourceException Add a resource bundle for labels associated with configuration parameters. The second argument (clazz) is used to determine the class loader for the resource bundle. It can be any class whose class loader can find the resource bundle, but typically one will use a factory class name (or parm-manager class name), with the corresponding resource or property file in the same directory or jar file as the factory class being loaded or initialized. The baseName argument may be one of the following:- a simple class name. In this case, if clazz is in a named package, the package name of clazz, followed by a period, will be prepended to baseName.
- a fully qualified class name. In this case, baseName is used as is, but a run time check will ensure that the package component of the name matches clazz's package or a subpackage of clazz's package named "lpack".
- an asterisk followed by a period, followed by a qualified or simple class name. In this case the asterisk is replaced with clazz's package name, which must not be the unnamed package. The resource bundle must be in the same package as clazz or in a subpackage named lpack.
- Parameters:
baseName
- the name of a class representing this resourceclazz
- the class of the factory, parm manager, or a class annotated with CompoundParmType, adding the resource bundle- Throws:
NullPointerException
- an argument was nullMissingResourceException
- the first argument did not refer to a resource that could be foundSecurityException
- the packages for clazz and baseName differ or clazz's package is not the package of the factory or one of its superclasses
-
addLabelResourceBundle
protected void addLabelResourceBundle(String keyPrefix, String delimiter, String baseName, Class clazz) throws NullPointerException, MissingResourceException Add a resource bundle for labels associated with keyed configuration parameters. The fourth argument (clazz) is used to determine the class loader for the resource bundle. It can be any class whose class loader can find the resource bundle, but typically one will use a factory class name (or parm-manager class name), with the corresponding resource or property file in the same directory or jar file as the factory class being loaded or initialized. The baseName argument may be one of the following:- a simple class name. In this case, if clazz is in a named package, the package name of clazz, followed by a period, will be prepended to baseName.
- a fully qualified class name. In this case, baseName is used as is, but a run time check will ensure that the package component of the name matches clazz's package or a subpackage of clazz's package named "lpack".
- an asterisk followed by a period, followed by a qualified or simple class name. In this case the asterisk is replaced with clazz's package name, which must not be the unnamed package. The resource bundle must be in the same package as clazz or in a subpackage named lpack.
- Parameters:
keyPrefix
- the prefix for a keyed parameter namedelimiter
- the delimiter for a keyed parameter namebaseName
- the name of a class representing this resourceclazz
- the class of the factory, parm manager, or a class annotated with CompoundParmType, adding the resource bundle- Throws:
NullPointerException
- an argument was nullMissingResourceException
- the first argument did not refer to a resource that could be foundSecurityException
- the packages for clazz and baseName differ or clazz's package is not the package of the factory or one of its superclasses
-
getLabel
Get a label. This will typically be used by a GUI to provide a label for a text field or other parameter.- Parameters:
name
- the name of a parameter- Returns:
- a string providing the label
- Throws:
IllegalArgumentException
-
addTipResourceBundle
protected void addTipResourceBundle(String baseName, Class clazz) throws NullPointerException, MissingResourceException Add a resource bundle for tips associated with configuration entries. The second argument (clazz) is used to determine the class loader for the resource bundle. It can be any class whose class loader can find the resource bundle, but typically one will use a factory class name (or parm-manager class name), with the corresponding resource bundle (or property file) in the same directory or jar file as the factory class being loaded or initialized. The baseName argument may be one of the following:- a simple class name. In this case, if clazz is in a named package, the package name if clazz, followed by a period will be prepended to baseName.
- a fully qualified class name. In this case, baseName is used as is, but a run time check will ensure that the package component of the name matches clazz's package.
- an asterisks followed by a period, followed by a qualified or simple class name. In this case, clazz's package name is prepended to baseName when clazz is in a named package. Otherwise the leading ".*" is removed from baseName.
- Parameters:
baseName
- the name of a class representing this resourceclazz
- the class of the factory, parm manager, or a class annotated with CompoundParmType, adding the resource bundle- Throws:
NullPointerException
- an argument was nullMissingResourceException
- the first argument did not refer to a resource that could be foundSecurityException
- the packages for clazz and baseName differ or clazz's package is not the package of the factory or one of its superclasses
-
addTipResourceBundle
protected void addTipResourceBundle(String keyPrefix, String delimiter, String baseName, Class clazz) throws NullPointerException, MissingResourceException Add a resource bundle for tips associated with compound configuration entries. The fourth argument (clazz) is used to determine the class loader for the resource bundle. It can be any class whose class loader can find the resource bundle, but typically one will use a factory class name (or parm-manager class name), with the corresponding resource or property file in the same directory or jar file as the factory class being loaded or initialized. The baseName argument may be one of the following:- a simple class name. In this case, if clazz is in a named package, the package name if clazz, followed by a period will be prepended to baseName.
- a fully qualified class name. In this case, baseName is used as is, but a run time check will ensure that the package component of the name matches clazz's package.
- an asterisks followed by a period, followed by a qualified or simple class name. In this case, clazz's package name is prepended to baseName when clazz is in a named package. Otherwise the leading ".*" is removed from baseName.
- Parameters:
keyPrefix
- the prefix for a keyed parameter namedelimiter
- the delimiter for a keyed parameter namebaseName
- the name of a class representing this resourceclazz
- the class of the factory, parm manager, or a class annotated with CompoundParmType, adding the resource bundle- Throws:
NullPointerException
- an argument was nullMissingResourceException
- the first argument did not refer to a resource that could be foundSecurityException
- the packages for clazz and baseName differ or clazz's package is not the package of the factory or one of its superclasses
-
getTip
Get a tip. This will typically be used by a GUI to provide a tip describing a text field or other parameter.- Parameters:
name
- the name of a parameter- Returns:
- a string providing the tip.
- Throws:
IllegalArgumentException
-
addDocResourceBundle
protected void addDocResourceBundle(String baseName, Class clazz) throws NullPointerException, MissingResourceException Add a resource bundle for docs associated with configuration entries. The second argument (clazz) is used to determine the class loader for the resource bundle. It can be any class whose class loader can find the resource bundle, but typically one will use a factory class name (or parm-manager class name), with the corresponding resource bundle (or property file) in the same directory or jar file as the factory class being loaded or initialized. The baseName argument may be one of the following:- a simple class name. In this case, if clazz is in a named package, the package name if clazz, followed by a period will be prepended to baseName.
- a fully qualified class name. In this case, baseName is used as is, but a run time check will ensure that the package component of the name matches clazz's package.
- an asterisks followed by a period, followed by a qualified or simple class name. In this case, clazz's package name is prepended to baseName when clazz is in a named package. Otherwise the leading ".*" is removed from baseName.
- Parameters:
baseName
- the name of a class representing this resourceclazz
- the class of the factory, parm manager, or a class annotated with CompoundParmType, adding the resource bundle- Throws:
NullPointerException
- an argument was nullMissingResourceException
- the first argument did not refer to a resource that could be foundSecurityException
- the packages for clazz and baseName differ or clazz's package is not the package of the factory or one of its superclasses
-
addDocResourceBundle
protected void addDocResourceBundle(String keyPrefix, String delimiter, String baseName, Class clazz) throws NullPointerException, MissingResourceException Add a resource bundle for docs associated with compound configuration entries. The fourth argument (clazz) is used to determine the class loader for the resource bundle. It can be any class whose class loader can find the resource bundle, but typically one will use a factory class name (or parm-manager class name), with the corresponding resource or property file in the same directory or jar file as the factory class being loaded or initialized. The baseName argument may be one of the following:- a simple class name. In this case, if clazz is in a named package, the package name if clazz, followed by a period will be prepended to baseName.
- a fully qualified class name. In this case, baseName is used as is, but a run time check will ensure that the package component of the name matches clazz's package.
- an asterisks followed by a period, followed by a qualified or simple class name. In this case, clazz's package name is prepended to baseName when clazz is in a named package. Otherwise the leading ".*" is removed from baseName.
- Parameters:
keyPrefix
- the prefix for a keyed parameter namedelimiter
- the delimiter for a keyed parameter namebaseName
- the name of a class representing this resourceclazz
- the class of the factory, parm manager, or a class annotated with CompoundParmType, adding the resource bundle- Throws:
NullPointerException
- an argument was nullMissingResourceException
- the first argument did not refer to a resource that could be foundSecurityException
- the packages for clazz and baseName differ or clazz's package is not the package of the factory or one of its superclasses
-
getDoc
Get a doc. This will typically be used by a GUI to provide a doc describing a text field or other parameter.- Parameters:
name
- the name of a parameter- Returns:
- a string providing the doc.
- Throws:
IllegalArgumentException
-
setLayoutResource
Set the name of a resource specifying how a GUI should configure this factory.- Parameters:
resource
- the name for the resource
-
setLayoutResource
Set the name of a resource specifying how a GUI should configure this factory given its class. The resource name will be the same as the class name but with each '.' replaced with a '/', and with ".xml" added as an extension.- Parameters:
clazz
- the classextension
- a resource extension (excluding the '.' separating it from the rest of the resource name)- Throws:
NullPointerException
- an argument was nullIllegalArgumentException
- after trimming leading and trailing whitespace, the extension was an empty string
-
getLayoutResource
Return the name of the resource specifying how a GUI should configure this factory.- Returns:
- the resource; null if there is none
-
initParms
Initialize parameters table. A subclass must call this method, typically inside a constructor. The clazz argument will normally be the name of the constructor with ".class" appended to it.- Parameters:
parms
- an array of parametersclazz
- the class defining a set of parameters, typically the name of the class whose constructor calls initParms
-
initParm
Initialize parameters table by adding a single parameter. A subclass must call this method, typically inside a constructor. The clazz argument will normally be the name of the constructor with ".class" appended to it.- Parameters:
parm
- the parameterclazz
- the class defining a set of parameters, typically the name of the class whose constructor calls initParms
-
initParms
Initialize parameters specified by a ParmManager. A subclass must call this method, typically inside a constructor. The clazz argument will normally be the name of the constructor with ".class" appended to it.Note: when a parm manager is created by using the annotation
FactoryParmManager
, the generic type parameters will match those of the factory being annotated. These must have the same type-parameter names as in the factory's class definition, as shown above: subclasses of ParmManager do not necessarily use the same type parameters that ParmManager uses.- Parameters:
manager
- a parameter manager specifying parametersclazz
- the class defining this set of parameters, typically the name of the class whose constructor calls initParms
-
removeParms
Remove parameters previously named. This method is intended for cases in which the parameter names provided by a superclass should not be used by a subclass. A subclass must call this method, typically inside a constructor.- Parameters:
parmNames
- the names of the parameters to remove
-
removeParm
Remove a single parameter that was previously named. A subclass must call this method, typically inside a constructor.- Parameters:
name
- the names of the parameters to remove
-
parmNames
Get the names of parameters.- Returns:
- an enumeration of the allowed parameter names
-
parmNameSet
Get a set of the names of entries. This method produces a snapshot of the parameter names that existed when the method was called. While creating a new set is not particularly efficient, this method is rarely used. It is intended for finding parameter names in lexical order.- Returns:
- a set of the allowed parameter names
-
keyType
Determine the type of a key, if any.- Parameters:
name
- the name of the value- Returns:
- the class representing the key type; null if there is no key for this parameter
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
getFactoryClass
Get the class for the factory that defined a parameter name- Parameters:
name
- the name of the value- Returns:
- the class of the factory that defined the parameter; null if unknown
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
getParmKeyType
Get the parameter-key-type data for a parameter.- Parameters:
name
- the name of a parameter- Returns:
- the ParmKeyType object describing the key for this parameter; null if the key is not a compound key
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
getType
Determine the type of a parameter's value.- Parameters:
name
- the name of the value- Returns:
- a class denoting the parameter's value's type, which can be int.class, double.class, long.class, boolean.class, String.class, the class name of a named object that the object namer accepts (in which case the type is really String.class as a corresponding value is a name of an interned named object), or null if there is no value
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
getRVMode
Get the random-variable mode.- Parameters:
name
- the name of an entry- Returns:
- true if a random variable used in a call to
set
should be considered to be the value used to initialize an object; false if that random variable is used to generate the value used to initialize an object - Throws:
IllegalArgumentException
- there is no entry for the specified name
-
getGLB
Get the GLB (Greatest Lower Bound) for the allowed range of values.- Parameters:
name
- the name of an entry- Returns:
- the greatest lower bound; null if none is defined
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
glbInRange
Determine if the GLB (Greatest Lower Bound) for the range of allowed values is in that set.- Parameters:
name
- the name of an entry- Returns:
- true if the GLB is in the allowed range; false if not; undefined if there a GLB was not defined.
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
getLUB
Get the LUB (Least Upper Bound) for the allowed range of values.- Parameters:
name
- the name of an entry- Returns:
- the greatest lower bound; null if none is defined
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
lubInRange
Determine if the LUB (Least Upper Bound) for the range of allowed values is in that set.- Parameters:
name
- the name of an entry- Returns:
- true if the GLB is in the allowed range; false if not; undefined if there a GLB was not defined.
- Throws:
IllegalArgumentException
- there is no entry for the specified name
-
unset
Clear an entry and restore it to the default value.- Parameters:
name
- the name of the entry- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
clear
public void clear()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. -
add
Add a value provided as a string to as set of strings.- 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
-
add
Add a value provided as a named object to a set of named objects.- 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
-
add
Add a value provided as an enumeration to a set of enumerations.- 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
-
add
Add a value provided as an int to a set of integers.- 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
-
add
Add a value provided as a long to a set of integers. The long-integer argument will be converted to an int as this method is provided to support polymorphism.- 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
-
add
Add a value provided as a double to a set of integers. The double-precision value will be converted to an int as this method is provided to support polymorphism.- 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
-
add
Add a compound key provided as two objects. This is handles a special case - a compound key with two components - and is equivalent toObject compoundKey[] = {key, subkey}; add(name, compoundKey);
- Parameters:
name
- the name of the entrykey
- the first keysubkey
- the second key- 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
-
add
Add a value provided as an array of objects representing a compound key. If the array length is larger than 1, the parameter must use a ParmKeyType to describe its keys.- Parameters:
name
- the name of the entryvalue
- an array containing the keys- 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- See Also:
-
mustAdd
Test if a name must be added rather than set.- Parameters:
name
- the name of the entry or property- Returns:
- true if it must be added; false otherwise
-
canAdd3
Test if a the three-argument form of add can be used.- Parameters:
name
- the name of the entry or property- Returns:
- true if the three-argument form of add can be used; false otherwise
-
isClearOnly
Determine if a parameter is a clear-only parameter. A clear-only parameter does not supportset
oradd
methods, justclear
methods. A few such methods are provided in order to allow users to conveniently clear a table.- Parameters:
name
- the name of the paraemter- Returns:
- true if the parameter is clear only; otherwise false
-
set
Set a value provided as a string.- 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
-
set
Set a value provided as a named object.- 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
-
set
Set a value provided as an enumeration type.- 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
-
set
Set a value provided as an int.- 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
-
set
Set a value provided as an integer-valued random variable.- 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
-
set
public void set(String name, IntegerRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-random-variable-valued random variable.- 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
-
set
Set a value provided as a long.- 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
-
set
Set a value provided as an long-valued random variable.- Parameters:
name
- the name of the entryvalue
- the value of the object- Throws:
IllegalArgumentException
- an argument is out of bounds or the name does not match a parameterUnsupportedOperationException
- the factory does not allow this method to be usedIllegalStateException
- the factory is not in a state for which this value may be parsed and enteredNamedObjectFactory.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
-
set
Set a value provided as a long-random-variable-valued random variable.- 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
-
set
Set a value provided as a double.- 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
-
set
Set a value provided as a double-valued random variable.- 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
-
set
public void set(String name, DoubleRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as a double-random-variable-valued random variable.- 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
-
set
Set a value provided as a boolean.- 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
-
set
Set a value provided as an boolean-valued random variable.- 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
-
set
public void set(String name, BooleanRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-random-variable-valued random variable.- 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
-
unset
public void unset(String name, int index) throws IllegalArgumentException, UnsupportedOperationException Unset an entry with an index and restore it to the default value.- Parameters:
name
- the name of the entryindex
- the index for the entry- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
unset
public void unset(String name, NamedObjectOps key) throws IllegalArgumentException, UnsupportedOperationException Unset an entry with a named-object key and restore it to the default value.- Parameters:
name
- the name of the entrykey
- the key- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
unset
public void unset(String name, Enum<?> key) throws IllegalArgumentException, UnsupportedOperationException Unset an entry with an enumeration key and restore it to the default value.- Parameters:
name
- the name of the entrykey
- the key for the entry- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
unset
public void unset(String name, Object[] key) throws IllegalArgumentException, UnsupportedOperationException Unset an entry with a compound key and restore it to the default value.- Parameters:
name
- the name of the entrykey
- the compound key for the entry- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
set
Set a value provided as a string, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, NamedObjectOps value) throws NamedObjectFactory.ConfigException Set a value provided as a named object, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
Set a value provided as an enumeration type, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
Set a value provided as an int, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, IntegerRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, IntegerRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-random-variable-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
Set a value provided as a long, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, LongRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an long-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, LongRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an long-random-variable-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
Set a value provided as a double, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, DoubleRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an double-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, DoubleRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an double-random-variable-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
Set a value provided as a boolean, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, BooleanRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, int index, BooleanRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-random-variable-valued random variable, given an index.- Parameters:
name
- the name of the entryindex
- the indexvalue
- 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; IndexOutOfBoundsException if the index is not in a legal range
-
set
public void set(String name, NamedObjectOps key, String value) throws NamedObjectFactory.ConfigException Set a value provided as a string, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, NamedObjectOps value) throws NamedObjectFactory.ConfigException Set a value provided as a named object, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, Enum<?> value) throws NamedObjectFactory.ConfigException Set a value provided as an enumeration type, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, int value) throws NamedObjectFactory.ConfigException Set a value provided as an int, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, IntegerRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, IntegerRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-random-variable-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, long value) throws NamedObjectFactory.ConfigException Set a value provided as a long, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, LongRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an long-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, LongRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an long-random-variable-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, double value) throws NamedObjectFactory.ConfigException Set a value provided as a double, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, DoubleRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an double-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, DoubleRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an double-random-variable-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, boolean value) throws NamedObjectFactory.ConfigException Set a value provided as a boolean, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, BooleanRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, NamedObjectOps key, BooleanRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-random-variable-valued random variable, given a named-object key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a string, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, NamedObjectOps value) throws NamedObjectFactory.ConfigException Set a value provided as a named object, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as an enumeration type, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as an int, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, IntegerRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, IntegerRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-random-variable-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a long, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, LongRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an long-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, LongRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an long-random-variable-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a double, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, DoubleRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an double-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, DoubleRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an double-random-variable-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a boolean, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, BooleanRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Enum<?> key, BooleanRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-random-variable-valued random variable, given an enumeration key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a string, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, NamedObjectOps value) throws NamedObjectFactory.ConfigException Set a value provided as a named object, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as an enumeration type, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as an int, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, IntegerRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, IntegerRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-random-variable-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a long, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, LongRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an long-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, LongRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an long-random-variable-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a double, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, DoubleRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an double-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, DoubleRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an double-random-variable-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a boolean, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, BooleanRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, Object[] key, BooleanRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an boolean-random-variable-valued random variable, given a compound key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a string, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, NamedObjectOps value) throws NamedObjectFactory.ConfigException Set a value provided as a named object, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as an enumeration, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as an int, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, IntegerRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, IntegerRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as an integer-random-variable-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a long, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, LongRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as a long-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, LongRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as a long-random-variable-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a double, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, DoubleRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as a double-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, DoubleRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as a double-random-variable-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
Set a value provided as a boolean, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, BooleanRandomVariable value) throws NamedObjectFactory.ConfigException Set a value provided as a boolean-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
set
public void set(String name, String key, BooleanRandomVariableRV value) throws NamedObjectFactory.ConfigException Set a value provided as a boolean-random-variable-valued random variable, given a key.- Parameters:
name
- the name of the entrykey
- the keyvalue
- 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; IndexOutOfBoundsException if the key is not in a legal range
-
clear
Clear keys by removing all keys associated with a parameter name or restore a parameter to its default value.- Parameters:
name
- the name of the entry- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
remove
public void remove(String name, String key) throws IllegalArgumentException, UnsupportedOperationException Remove an entry with a key from a set of strings.- Parameters:
name
- the name of the entrykey
- the key- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
remove
public void remove(String name, NamedObjectOps key) throws IllegalArgumentException, UnsupportedOperationException Remove an entry with a named-object key from a set of named objects.- Parameters:
name
- the name of the entrykey
- the key- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
remove
public void remove(String name, Enum<?> key) throws IllegalArgumentException, UnsupportedOperationException Remove an entry with an enumeration key from a set of enumerations.- Parameters:
name
- the name of the entrykey
- the key- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
remove
Remove an entry with an index from a set of integers.- Parameters:
name
- the name of the entrykey
- the key- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
remove
Remove a value provided as a long from a set of integers. The long-integer argument will be converted to an int as this method is provided to support polymorphism.- Parameters:
name
- the name of the entryvalue
- the value of the object- Throws:
IllegalArgumentException
- an argument is out of bounds or the name does not match a parameterUnsupportedOperationException
- the factory does not allow this method to be usedIllegalStateException
- the factory is not in a state for which this value may be parsed and entered
-
remove
Remove a value provided as a double from a set of integers. The double-precision value will be converted to an int as this method is provided to support polymorphism.- Parameters:
name
- the name of the entryvalue
- the value of the object- Throws:
IllegalArgumentException
- an argument is out of bounds or the name does not match a parameterUnsupportedOperationException
- the factory does not allow this method to be usedIllegalStateException
- the factory is not in a state for which this value may be parsed and entered
-
remove
Remove a compound key provided as two objects, undoing the corresponding add operation. This is handles a special case - a compound key with two components - and is equivalent toObject compoundKey[] = {key, subkey}; remove(name, compoundKey);
- Parameters:
name
- the name of the entrykey
- the first keysubkey
- the second key- Throws:
IllegalArgumentException
- an argument is out of bounds or the name does not match a parameterUnsupportedOperationException
- the factory does not allow this method to be used
-
remove
Remove an entry with a compound key, undoing the corresponding add operation.- Parameters:
name
- the name of the entrykey
- the key- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
unset
public void unset(String name, String key) throws IllegalArgumentException, UnsupportedOperationException Unset an entry with a key and restore it to the default value.- Parameters:
name
- the name of the entrykey
- the key- Throws:
IllegalArgumentException
- the argument does not match an entryUnsupportedOperationException
- the factory does not allow this entry to be removed
-
configureSupported
public boolean configureSupported()Determine if the configure method is supported by this factory's object namer.- Returns:
- true if configure(<Configuration Object>) is supported; false otherwise
-
configure
public void configure(Object scriptObject) throws UnsupportedOperationException, IllegalArgumentException Configure a factory. This is an optional operation. The default behavior is that the object namer handles the operation and throws an UnsupportedOperationException if it cannot. The existing configuration will not be cleared.- Parameters:
scriptObject
- an object in a scripting language, or instances ofJSObject
orJSArray
, representing a specification for how this factory should be configured- Throws:
UnsupportedOperationException
- the factory cannot be configured using a script objectIllegalArgumentException
- the scriptObject is ill formed
-
isRandomVariable
Determine if an object is an instance of RandomVariable<?>. This is intended for supporting scripting languages that might not have full visibility into the Java type system. It just returns (obj instanceof RandomVariable<?>).- Parameters:
obj
- the object- Returns:
- true if it is an instance of RandomVariable<?> or one of RandomVariable's subclasses; false otherwise
-
isNamedObject
Determine if an object is an instance of a named object. This is intended for supporting scripting languages that might not have full visibility into the Java type system.- Parameters:
obj
- the object- Returns:
- true if it is an instance of the base name object for the object namer associated with this factory, or one of that named object's subclasses; false otherwise
-
setNameRoot
Set the initial part of a name to use when creating objects. The name provided will be prefaced and followed with "_".- Parameters:
nameRoot
- the factory-unique part of a name
-
getNextName
Generate a named-object name.- Returns:
- a named-object name
-
getNextNameIndex
protected long getNextNameIndex()Generate a unique index to append to a string to generate a name.- Returns:
- the index
-
startObjectCreation
protected void startObjectCreation()Start a sequence of creation of new objects. This method is called at the start of the methodscreateObject
andcreateObjects
unless these methods are overridden. The default method does nothing. Subclasses that override this method must start with the statement "super.startObjectCreation();
". -
endObjectCreation
protected void endObjectCreation()End a sequence of creation of new objects. This method is called at the end of the methodscreateObject
andcreateObjects
unless these methods are overridden, including the case of an abnormal termination. The default method does nothing. Subclasses that override this method must start with the statement "super.endObjectCreation();
". -
newObject
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
.- Parameters:
name
- the name of the object to be created- Returns:
- the new object
- See Also:
-
initObject
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);
".- Parameters:
object
- the object to initialize
-
arrayInit
protected <T> void arrayInit(T[] array, int offset, int n) Apply additional initializations after an array of objects has been created and each initialized by callinginitObject(obj)
. The default implementation does nothing. This method is called from methods namedcreateObjects
afterinitObject
has been called on each of the objects that will be created. Subclasses should that override this method to provide subclass-specific initializations must start with the statement "super.arrayInit(array, offset, n);
".- Type Parameters:
T
- the type of the objects that are created- Parameters:
array
- an array of objects that were created and initializedoffset
- the starting point in the arrayn
- the number of elements to initialize, starting at the offset
-
doAfterInits
Final initialization code. Called on each object being initialized after all other initialization steps have been completed (i.e., afterinitObject
and possiblyarrayInit
). This will be called the methods namedcreateObject
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.doAfterInits(object);"
.- Parameters:
object
- the object whose initialization is to be completed
-
setInterned
public void setInterned(boolean value) Specify if objects created will be interned. An object is interned if it appears in an object namer's tables and can thus be looked up by name.- Parameters:
value
- true if the objects will be interned; false if not
-
willIntern
public boolean willIntern()Determine if a created object will be interned. An object is interned if it appears in an object namer's tables and can thus be looked up by name.- Returns:
- true if it will be interned, false if not
-
createObject
Create a named object of the type this factory supports with the object's name generated by the factory. Generally this method should not be overridden as the object is actually created by newObject(). The factory configuration is not altered by a call to this method.- Returns:
- a named object
- See Also:
-
createObject
Create a named object of the type this factory supports. Generally this method should not be overridden as the object is actually created by newObject(). The factory configuration is not altered by a call to this method.- Parameters:
name
- the name of the object- Returns:
- a named object
-
createObject
Create a named object of the type this factory supports, modifying the factory configuration. The existing configuration, if any, will be cleared and then replaced with the configuration specified by the scriptObject argument Generally this method should not be overridden as the object is actually created by newObject().- Parameters:
name
- the name of the objectscriptObject
- an object in a scripting language representing a specification for how this factory should be configured- Returns:
- a named object
-
createObject
Create a named object of the type this factory supports, setting or modifying the factory configuration. Generally this method should not be overridden as the object is actually created by newObject(). Regardless of whether the existing configuation is cleared, the configuration after the scriptObject argument is processed will not be changed by this method after the object is created.- Parameters:
name
- the name of the objectclearConfig
- true if the existing configuration should be cleared; false otherwisescriptObject
- an object in a scripting language representing a specification for how this factory should be configured- Returns:
- a named object
-
createObjects
public <T> T[] createObjects(T[] array) Create named objects with the names generated by the factory and the number of objects determined by an array size.- Type Parameters:
T
- the type of the created objects- Parameters:
array
- the array into which the created objects are to be stored if large enough; otherwise a new array of the same type is allocated- Returns:
- the objects that were created
- Throws:
ArrayStoreException
- if the runtime type of the specified array is not a supertype of the runtime type of every object createdNullPointerException
- if the specified array is null
-
createObjects
public <T> T[] createObjects(T[] array, int n) Create named objects with the names generated by the factory. Generally this method should not be overridden as each object is actually created by newObject().- Type Parameters:
T
- the type of the created objects- Parameters:
array
- the array into which the created objects are to be stored if large enough; otherwise a new array of the same type is allocatedn
- the number of objects to create- Returns:
- an array containing the newly created objects
- Throws:
ArrayStoreException
- if the runtime type of the specified array is not a supertype of the runtime type of every object createdNullPointerException
- if the specified array is null
-
createObjects
public <T> T[] createObjects(T[] array, int offset, int n) Create named objects given an offset with the names generated by the factory. Generally this method should not be overridden as each object is actually created by newObject(). This method is intended for cases in which multiple calls to createObjects will be used to add entries to an array.- Type Parameters:
T
- the type of the created objects- Parameters:
array
- the array into which the created objects are to be storedoffset
- the offset into the array at which to startn
- the number of objects to create- Returns:
- an array containing the newly created objects
- Throws:
ArrayStoreException
- if the runtime type of the specified array is not a supertype of the runtime type of every object createdNullPointerException
- if the specified array is nullIllegalArgumentException
- the array length was too short given the offset
-
createObjects
Create named objects with the number of objects determined by an array.- Type Parameters:
T
- the type of the created objects- Parameters:
array
- the array into which the created objects are to be stored if large enough - otherwise a new array of the same type is allocated; object names will consist of a root name, followed by an "_", followed by a numberroot
- the root of a name- Returns:
- the objects that were created
- Throws:
ArrayStoreException
- if the runtime type of the specified array is not a supertype of the runtime type of every object createdNullPointerException
- if the specified array is null
-
createObjects
Create named objects. Generally this method should not be overridden as each object is actually created by newObject().- Type Parameters:
T
- the type of the created objects- Parameters:
array
- the array into which the created objects are to be stored if large enough; otherwise a new array of the same type is allocated; object names will consist of a root name, followed by an "_", followed by a numberroot
- the root of a namen
- the number of objects to create- Returns:
- an array containing the newly created objects
- Throws:
ArrayStoreException
- if the runtime type of the specified array is not a supertype of the runtime type of every object createdNullPointerException
- if the specified array is null
-
createObjects
Create named objects. Generally this method should not be overridden as each object is actually created by newObject(). This method is intended for cases where multiple calls to createObjects will be used to add entries to an array.- Type Parameters:
T
- the type of the created objects- Parameters:
array
- the array into which the created objects are to be stored; object names will consist of a root name, followed by an "_", followed by a numberroot
- the root of a nameoffset
- the offset into the array at which to startn
- the number of objects to create- Returns:
- an array containing the newly created objects at indices starting with the offset
- Throws:
ArrayStoreException
- if the runtime type of the specified array is not a supertype of the runtime type of every object createdNullPointerException
- if the specified array is nullIllegalArgumentException
- the array length was too short given the offset
-