Class TemporaryVariable

  • All Implemented Interfaces:
    java.lang.Cloneable, HasTypeConstraints, Typeable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, Settable, ValueListener

    public class TemporaryVariable
    extends Variable
    This is identical to a Variable except that creating it does not increment the workspace version. It should be used to create a variable to store information and make that information visible to the user, but where the presence of this variable has no bearing on type resolution, scheduling, model structure, or any other property of the model that might invalidate cached information. This variable should be used with caution, but use of this variable can significantly improve performance since it makes caching of information that is expensive to compute much more effective.
    Since:
    Ptolemy II 5.2
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Green (eal)
    • Constructor Detail

      • TemporaryVariable

        public TemporaryVariable​(NamedObj container,
                                 java.lang.String name)
                          throws IllegalActionException,
                                 NameDuplicationException
        Construct a variable with the given name as an attribute of the given container. The container argument must not be null, otherwise a NullPointerException will be thrown. This variable will use the workspace of the container for synchronization and version counts, but creation of this variable will not increment the version number of that workspace. If the name argument is null, then the name is set to the empty string.
        Parameters:
        container - The container.
        name - The name of the variable.
        Throws:
        IllegalActionException - If the container does not accept a variable as its attribute.
        NameDuplicationException - If the name coincides with a variable already in the container.