java.lang.Object
eu.qualimaster.easy.extension.internal.Utils

public class Utils extends Object
Utility methods.
Author:
Holger Eichelberger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
    Adds the binding time attribute to project.
    static net.ssehub.easy.varModel.model.FreezeBlock
    createFreezeBlock(List<net.ssehub.easy.varModel.model.IFreezable> freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
    Creates a freeze block for project.
    static net.ssehub.easy.varModel.model.FreezeBlock
    createFreezeBlock(net.ssehub.easy.varModel.model.IFreezable[] freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
    Creates a freeze block for project.
    static net.ssehub.easy.varModel.model.FreezeBlock
    createFreezeBlock(net.ssehub.easy.varModel.model.Project project)
    Adds a freeze block to the project containing all elements.
    static net.ssehub.easy.varModel.confModel.IDecisionVariable
    extractVariable(net.ssehub.easy.varModel.model.values.ReferenceValue refValue, net.ssehub.easy.varModel.confModel.Configuration config)
    Extracts an IDecisionVariable from the given ReferenceValue.
    static List<net.ssehub.easy.varModel.confModel.IDecisionVariable>
    extractVariables(net.ssehub.easy.varModel.model.values.ContainerValue refValues, net.ssehub.easy.varModel.confModel.Configuration config)
    Extracts all referenced IDecisionVariables from a container of ReferenceValues.
    static net.ssehub.easy.varModel.confModel.IDecisionVariable
    findAlgorithm(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String name, boolean asReference)
    Finds an algorithm in family.
    static net.ssehub.easy.varModel.model.datatypes.Compound
    findCompound(net.ssehub.easy.varModel.model.Project project, String name)
    Finds a compound type.
    static net.ssehub.easy.varModel.confModel.IDecisionVariable
    findNamedVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name)
    Finds a named variable and throws an exception if not found.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • findCompound

      public static net.ssehub.easy.varModel.model.datatypes.Compound findCompound(net.ssehub.easy.varModel.model.Project project, String name) throws net.ssehub.easy.varModel.model.ModelQueryException
      Finds a compound type.
      Parameters:
      project - the project to start searching
      name - the name of the compound
      Returns:
      the compound type or null if none was found
      Throws:
      net.ssehub.easy.varModel.model.ModelQueryException - in case of violated project access restrictions
    • findNamedVariable

      public static net.ssehub.easy.varModel.confModel.IDecisionVariable findNamedVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) throws net.ssehub.easy.varModel.model.ModelQueryException
      Finds a named variable and throws an exception if not found.
      Parameters:
      config - the configuration to search within
      type - the type of the variable
      name - the name of the variable
      Returns:
      the variable
      Throws:
      net.ssehub.easy.varModel.model.ModelQueryException - if not found
    • findAlgorithm

      public static net.ssehub.easy.varModel.confModel.IDecisionVariable findAlgorithm(net.ssehub.easy.varModel.confModel.IDecisionVariable family, String name, boolean asReference) throws net.ssehub.easy.varModel.model.ModelQueryException
      Finds an algorithm in family.
      Parameters:
      family - the family
      name - the name of the algorithm
      asReference - return the reference to the algorithm or the algorithm itself
      Returns:
      the algorithm or its reference (depending on asReference)
      Throws:
      net.ssehub.easy.varModel.model.ModelQueryException - if the algorithm cannot be found
    • createFreezeBlock

      public static net.ssehub.easy.varModel.model.FreezeBlock createFreezeBlock(List<net.ssehub.easy.varModel.model.IFreezable> freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException
      Creates a freeze block for project. [legacy style, does not add to project]
      Parameters:
      freezables - the freezables
      project - the IVML project to add to (may be null if failed)
      fallbackForType - in case that project is being written the first time, may be null
      Returns:
      the created freeze block
      Throws:
      net.ssehub.easy.varModel.cst.CSTSemanticException - in case of CST errors
      net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case of unmatching values
      net.ssehub.easy.varModel.model.ModelQueryException - in case of model access problems
    • createFreezeBlock

      public static net.ssehub.easy.varModel.model.FreezeBlock createFreezeBlock(net.ssehub.easy.varModel.model.IFreezable[] freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException
      Creates a freeze block for project. [legacy style, does not add to project]
      Parameters:
      freezables - the freezables
      project - the IVML project to add to (may be null if failed)
      fallbackForType - in case that project is being written the first time, may be null
      Returns:
      the created freeze block
      Throws:
      net.ssehub.easy.varModel.cst.CSTSemanticException - in case of CST errors
      net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case of unmatching values
      net.ssehub.easy.varModel.model.ModelQueryException - in case of model access problems
    • createFreezeBlock

      public static net.ssehub.easy.varModel.model.FreezeBlock createFreezeBlock(net.ssehub.easy.varModel.model.Project project) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException
      Adds a freeze block to the project containing all elements.
      Parameters:
      project - the IVML project to freeze
      Returns:
      the created freeze block
      Throws:
      net.ssehub.easy.varModel.cst.CSTSemanticException - in case of CST errors
      net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case of unmatching values
      net.ssehub.easy.varModel.model.ModelQueryException - in case of model access problems
    • addRuntimeAttributeToProject

      public static void addRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) throws net.ssehub.easy.varModel.cst.CSTSemanticException, net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException, net.ssehub.easy.varModel.model.ModelQueryException
      Adds the binding time attribute to project.
      Parameters:
      project - the IVML project to add the attribute to
      fallbackForType - in case that project is being written the first time, may be null
      Throws:
      net.ssehub.easy.varModel.cst.CSTSemanticException - in case of CST errors
      net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case of unmatching values
      net.ssehub.easy.varModel.model.ModelQueryException - in case of model access problems
    • extractVariable

      public static net.ssehub.easy.varModel.confModel.IDecisionVariable extractVariable(net.ssehub.easy.varModel.model.values.ReferenceValue refValue, net.ssehub.easy.varModel.confModel.Configuration config)
      Extracts an IDecisionVariable from the given ReferenceValue.
      Parameters:
      refValue - A value pointing to an element of a pipeline.
      config - The complete configuration form where to take the IDecisionVariable.
      Returns:
      The referenced IDecisionVariable or in case of any errors null.
    • extractVariables

      public static List<net.ssehub.easy.varModel.confModel.IDecisionVariable> extractVariables(net.ssehub.easy.varModel.model.values.ContainerValue refValues, net.ssehub.easy.varModel.confModel.Configuration config)
      Extracts all referenced IDecisionVariables from a container of ReferenceValues.
      Parameters:
      refValues - A value pointing other declarations, must not use an expression.
      config - The complete configuration form where to take the IDecisionVariable.
      Returns:
      The referenced IDecisionVariables or an empty list in case of any errors.