Class VariableUsageCreator


  • public class VariableUsageCreator
    extends Entity
    This class constructs a VariableUsage. It is used to create the 'VariableUsage' object step-by-step, i.e. 'VariableUsageCreator' objects are of intermediate state.
    See Also:
    VariableUsage
    • Constructor Detail

      • VariableUsageCreator

        public VariableUsageCreator()
      • VariableUsageCreator

        public VariableUsageCreator​(String reference,
                                    String... innerReferences)
      • VariableUsageCreator

        public VariableUsageCreator​(String reference)
    • Method Detail

      • withName

        public VariableUsageCreator withName​(String name)
        Description copied from class: Entity
        Defines the unique name of this current entity. Once created entities are referenced by this name. Only entities with a unique name can be fetched from the model.
        Overrides:
        withName in class Entity
        Returns:
        this current entity in the making
      • withVariableCharacterisation

        public VariableUsageCreator withVariableCharacterisation​(String specificationStochasticExpression,
                                                                 org.palladiosimulator.pcm.parameter.VariableCharacterisationType type)
        Creates a VariableCharacterisation and adds it to the 'VariableUsage'.

        Variable characterizations store performance critical meta-information on a variable. For example, if a variable's value is used in a long running loop, the value of the variable is performance critical.
        Variable characterizations contain a type (VariableCharacterisationType), which tells what kind of meta-information is stored and a PCMRandomVariable for storing the value of the characterization.

        The stochastic Expression specification_stochasticExpression specifies the value of the characterization as a PCMRandomVariable. Possible values for the type are 'STRUCTURE', 'NUMBER_OF_ELEMENTS', 'BYTESIZE', 'TYPE', 'VALUE'.

        Parameters:
        specificationStochasticExpression - value of the characterization
        type - of the characterization
        Returns:
        the variable usage in the making
        See Also:
        VariableCharacterisation, VariableUsage
      • withVariableReference

        public VariableUsageCreator withVariableReference​(String reference)
        Creates a VariableReference and adds it to the 'VariableUsage'. A variable usage can have either a variable reference or a namespace reference that can contain inner references.

        The reference refers to the name of the characterized variable as a namedReference association.
        Note that it was an explicit design decision to refer to variable names instead of the actual variables (i.e., by referring to Parameter class).

        Parameters:
        reference - the name of the characterized variable
        Returns:
        the variable usage in the making
        See Also:
        AbstractNamedReference
      • withNamespaceReference

        public VariableUsageCreator withNamespaceReference​(String reference,
                                                           String... innerReferences)
        Creates a NamespaceReference and adds it to the 'VariableUsage'. A variable usage can have either a variable reference or a namespace reference that can contain inner references.

        The reference refers to the namespace of the characterized variable. The innerReferences are optional further namespace references, though the last innerRefernce will always be a VariableReference. Combined they act as a namedReference association.
        Note that it was an explicit design decision to refer to variable names instead of the actual variables (i.e., by referring to Parameter class).

        Parameters:
        reference - namespace reference of the characterized variable
        innerReferences - further namespace references and a variable reference of the characterized variable
        Returns:
        the variable usage in the making
        See Also:
        AbstractNamedReference
      • build

        public org.palladiosimulator.pcm.parameter.VariableUsage build()
        Description copied from class: Entity
        Turns the entity in the making into the finished entity.
        Specified by:
        build in class Entity
        Returns:
        the finished entity