Class SimFunctionTwoFactory

All Implemented Interfaces:
Cloneable

public class SimFunctionTwoFactory extends DefaultSimObjectFactory<SimFunctionTwo>
Factory for simulation objects providing functions. Unlike most named-object factories, the values passed as the final argument to 'set' methods can be cast to the type Object, either explicitly or due to variable assignment or the return value of a some method. This flexibility is provided so that the value of the "object" parameter can be an instance of RealValuedFunctionTwo or some object defined in a scripting language.

The parameters this class supports are the following:

  • Constructor Details

    • SimFunctionTwoFactory

      public SimFunctionTwoFactory(Simulation sim)
      Constructor.
      Parameters:
      sim - the simulation used to name objects.
    • SimFunctionTwoFactory

      public SimFunctionTwoFactory()
      Constructor for service provider. This constructor should not be used directly. It is necessary because of the introduction of modules in Java 9, and is used by a service provider that allows factories to be listed, possibly with documentation regarding their parameters. It just calls the default constructor with a null argument.
  • Method Details

    • clear

      public void clear()
      Description copied from class: NamedObjectFactory
      Clear all entries and restore to default values. Note: each subclass that implements this method should call super.clear(). Any subclass that defines parameters should call this method in order to restore the parameters to their default values. When an annotation processor is used for some parameters, those parameters can be restored to their default value by calling the parm manager's setDefaults method with the factory as its argument.
      Overrides:
      clear in class SimObjectFactory<DefaultSimObjectFactory<SimFunctionTwo>,Simulation,SimFunctionTwo>
    • set

      public void set(String name, Object value) throws NamedObjectFactory.ConfigException
      Set a value provided as a object. This customizes the factory for the "object" parameter.
      Parameters:
      name - the name of the entry
      value - the value of the object
      Throws:
      NamedObjectFactory.ConfigException - an exception encapsulating an IllegalArgumentException if an argument is out of bounds or the name does not match a parameter; an UnsupportedOperationException if the factory does not allow this method to be used; an IllegalStateException if the factory is not in a state for which this value may be parsed and entered;
    • newObject

      protected final SimFunctionTwo newObject(String name)
      Description copied from class: NamedObjectFactory
      Construct a new object. The object will not be initialized. This method is called by createObject() and createObjects unless these methods are overridden. Subclasses should call willIntern() to determine if the object will interned or not, and getObjectNamer() 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 type Foo, newObject will execute the expression
      
            new Foo(getSimulation(), name, willIntern())
       
      or an equivalent expression, where name is the argument passed to newObject.
      Specified by:
      newObject in class NamedObjectFactory<DefaultSimObjectFactory<SimFunctionTwo>,Simulation,SimObject,SimFunctionTwo>
      Parameters:
      name - the name of the object to be created
      Returns:
      the new object
      See Also:
    • initObject

      protected void initObject(SimFunctionTwo simFunction)
      Description copied from class: NamedObjectFactory
      Initialize an object. This method will call the methods for the object necessary to initialize it based on how the factory was configured, and is called by createObject() and createObjects unless these methods are overridden. The default method does nothing. Subclasses that override this method to provide subclass-specific initializations must start with the statement "super.initObject(object);".
      Overrides:
      initObject in class SimObjectFactory<DefaultSimObjectFactory<SimFunctionTwo>,Simulation,SimFunctionTwo>
      Parameters:
      simFunction - the object to initialize