Class VariableHelper

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

public class VariableHelper extends Object
Some utility functions for IVML variables.
Author:
Holger Eichelberger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final 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 of given type in config.
    static final net.ssehub.easy.varModel.confModel.IDecisionVariable
    findNamedVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name)
    Finds a named variable of given type in variable.
    static final Boolean
    getBoolean(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
    Returns the value of a boolean compound slot.
    static final Double
    getDouble(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
    Returns the value of a double compound slot.
    static final Integer
    getInteger(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
    Returns the value of an integer compound slot.
    static String
    getName(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
    Returns the logical name of var from slot QmConstants.SLOT_NAME.
    static final String
    getString(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
    Returns the value of a string compound slot.
    static boolean
    hasName(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
    Returns whether var has a slot QmConstants.SLOT_NAME and the value is a string equals to name.

    Methods inherited from class java.lang.Object

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

    • VariableHelper

      public VariableHelper()
  • Method Details

    • getName

      public static String getName(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
      Returns the logical name of var from slot QmConstants.SLOT_NAME.
      Parameters:
      var - the variable (may be null)
      Returns:
      the name of var, null if there is none
    • hasName

      public static boolean hasName(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
      Returns whether var has a slot QmConstants.SLOT_NAME and the value is a string equals to name.
      Parameters:
      var - the variable (may be null)
      name - the name to look for
      Returns:
      true if var has the given name, false (in all cases)
    • getBoolean

      public static final Boolean getBoolean(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
      Returns the value of a boolean compound slot.
      Parameters:
      var - the variable to look into (may be null)
      name - the name of the slot
      Returns:
      the boolean value of the slot, null if there is no variable, no slot or no boolean value in the slot
    • getString

      public static final String getString(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
      Returns the value of a string compound slot.
      Parameters:
      var - the variable to look into (may be null)
      name - the name of the slot
      Returns:
      the string value of the slot, null if there is no variable, no slot or no string value in the slot
    • getInteger

      public static final Integer getInteger(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
      Returns the value of an integer compound slot.
      Parameters:
      var - the variable to look into (may be null)
      name - the name of the slot
      Returns:
      the integer value of the slot, null if there is no variable, no slot or no integer value in the slot
    • getDouble

      public static final Double getDouble(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name)
      Returns the value of a double compound slot.
      Parameters:
      var - the variable to look into (may be null)
      name - the name of the slot
      Returns:
      the double value of the slot, null if there is no variable, no slot or no integer value in the slot
    • findNamedVariable

      public static final 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 of given type in config.
      Parameters:
      config - the configuration
      type - the type to search for (ignored if null)
      name - the (logical) name
      Returns:
      the decision variable
    • findNamedVariable

      public static final net.ssehub.easy.varModel.confModel.IDecisionVariable findNamedVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name)
      Finds a named variable of given type in variable.
      Parameters:
      variable - the variable to search for
      type - the type to search for (ignored if null)
      name - the (logical) name
      Returns:
      the decision variable