net.simplace.simulation.util.FWSimVariable




public class FWSimVariable {
// Protected Constructors
protected FWSimVariable(String aName, String aDescription, String aRule,
FWSimVariable.DATA_TYPE aDataType, FWSimVariable.CONTENT_TYPE
aContentType, String aUnit, Object aValue, Number aMin, Number aMax,
Object aDefault, Integer[] aCount, FWSimVariable.MODE_TYPE aModeType,
FWSimVarMap aVarMap, FWSimFieldContainer aSourceSimComponent);
protected FWSimVariable(FWSimVariable.MetaData aMetaData, Object aValue,
FWSimVarMap aVarMap);


// Class Methods
public static FWSimVariable createSimVariable(Element aVarElement,
FWSimFieldContainer aFWSimFieldContainer);

factory method to create a FWSimVariable (Typed)
returns the new created Variable
public static FWSimVariable createSimVariable(String aName, String aDesc,
FWSimVariable.DATA_TYPE aDataType, FWSimVariable.CONTENT_TYPE
aContentType, String aUnit, Number aMin, Number aMax, Object aDefault,
FWSimFieldContainer aSourceSimComponent);

factory method to create a component sim variable for net.simplace.simulation.util.FWSimVariable.CONTENT_TYPE out use method above
returns the new created Variable
public static FWSimVariable createOutputSimVariable(String aName, String
aDesc, String aRule, FWSimVariable.DATA_TYPE aDataType, String aUnit,
String aOutputFormat, Object aDefault, FWSimVariable.MODE_TYPE aModeType,
FWSimFieldContainer aTarget);

factory method to create an output (system-output - not component output) sim variable for net.simplace.simulation.util.FWSimVariable.CONTENT_TYPE out use method above.
returns the new created Variable
public static Object setValueAndDefault(Object aObject, FWSimVariable
aSimVariable, FWSimFieldContainer aSourceComponent)
throws SimValueOutOfRangeException, SimLinkInvalidException;

static factory implementation for setting unknown object type to a given FWSimVariable with type F
returns the Value set with correct type
public static Object setValue(Object aObject, FWSimVariable aSimVariable,
FWSimFieldContainer aSourceComponent) throws SimValueOutOfRangeException,
SimLinkInvalidException;

static factory implementation for setting unknown object type to a given FWSimVariable with type F
returns the Value set with correct type
public static Object transformDataType(String aObject,
FWSimVariable.DATA_TYPE aDataType) throws NumberFormatException;

static implementation of a data converter if possible use static setValue()-Method instead
returns the transformed data object
public static String transformDataTypeToDB(FWSimVariable.DATA_TYPE aDataType);

transforms from Database type to net.simplace.simulation.util.FWSimVariable.DATA_TYPE
returns the {@link DATA_TYPE}
public static FWSimVariable.DATA_TYPE transformDBDataType(String dataType);

transforms from Database type to net.simplace.simulation.util.FWSimVariable.DATA_TYPE
returns the {@link DATA_TYPE}
public static String transformJavaDataType(FWSimVariable.DATA_TYPE aDataType);


returns the Java Type Name
public static FWSimVariable.DATA_TYPE transformJavaDataType(String dataType);

transforms from written code style type to net.simplace.simulation.util.FWSimVariable.DATA_TYPE
returns the {@link DATA_TYPE}
public static String transformContentType(FWSimVariable.CONTENT_TYPE
aContentType);


returns good toString information
public static Element createFormFields(FWSimVariable aVariable,
FWSimVariable.CONTENT_TYPE aComponentContentType, String aDescription,
String aFrequence, String aVisible, String aEnabled, boolean
aMultipleVarType);


returns the FormElement
public static Element createFormFields(String aName, String aDescription,
String aContentTypeDefault, String aVisible, String aEnabled,
FWSimVariable.CONTENT_TYPE aComponentContentType);


returns the FormElement
public static Element createMultipleFormElement(FWSimVariable aVariable,
String aName, String aDescription, String aVisible, String aEnabled,
String aContentType, String tModeType, boolean aModeNeeded, String
aFrequence, String tDataType, String tUnit, String tMax, String tMin,
String tRule, String tDesc, String tDefault, FWSimVariable.CONTENT_TYPE
aComponentContentType);


returns the Form Element
public static Element createFormElement(FWSimVariable aVariable, String
aName, String aDescription, String aVisible, String aEnabled, String
aContentType, String aModeType, boolean aModeNeeded, String tDataType,
String tUnit, String tMax, String tMin, String tRule, String tDesc,
String tDefault, FWSimVariable.CONTENT_TYPE aComponentContentType);


returns the Form Element
public static FWSimVariable updateFields(FWSimVariable aVariable,
FWObservable aObservable) throws SimLinkInvalidException,
SimValueOutOfRangeException;


returns a new created sim variable

// Public Instance Methods
public void fillMetaDataFromSource(FWSimVarMap aVarMap);

public boolean isNumber();


returns if Variable is a Number (int or double)
public boolean hasRule();


returns true if has a rule implemented
public boolean isDouble();


returns true if variable is double or array of double
public boolean isInt();


returns true if variable contains int or array of int
public boolean isBoolean();


returns true if variable is boolean
public boolean isString();


returns true if variable is char type
public boolean isDate();


returns true if variable is of date type
public boolean isArray();


returns true if variable is an array (int or double)
public boolean isOutputContent();


returns false if this is of type Input field: input or constant, else true
public boolean isInputContent();


returns true if this is of type Input field: input or constant, else false
public boolean isMeasData();


returns the isMeasData
public Boolean changed();


returns true the variable has been changed within last model day (0 to 1 days) or null if SimModel is null.
public String getDescription();


returns description of this variable
public FWSimVariable.DATA_TYPE getDataType();


returns the dataType
public FWSimVariable.CONTENT_TYPE getContentType();


returns the contentType
public FWSimVariable.MODE_TYPE getModeType();


returns the modeType
public Number getMax();


returns the max
public Number getMin();


returns the min
public Object getValue();

Use this method to get value out of the variable by default!
returns the value
public TreeMap forceDoubleMapValue() throws SimFieldTypeException;


returns a Tree Map with fixed order derived from a double array
public boolean forceBooleanValue(boolean aDefault);

forces a value to be returned as boolean !!! don't use this method for variables type Boolean !!!
returns the boolean parameter - or the default
public double forceDoubleValue();

forces a value to be returned as double !!! don't use this method for variables type double !!!
returns the double parameter
public int forceIntValue();

forces a value to be returned as integer !!! don't use this method for variables type integer !!!
returns the integer parameter
public String forceStringValue();

forces a value to be returned as string !!! don't use this method for variables type string !!!
returns the string parameter
public void setDefaultValue();

replaces the value with the default - even if default is null value
public void reset();

replaces the value with the default - even if default is null value
public void setVarMap(FWSimVarMap aFwSimvarMap);

public void setModeType(FWSimVariable.MODE_TYPE aModeType);

public void setRule(String aRule);

public void changeDefaultValue(Object aValue);

changes default value
public void setNull(FWSimFieldContainer aSource);

sets value to null: - checks for authentication - sets the current date when the value had changed last time - but only if SimModel was registered
public void setValue(Object aValue, FWSimFieldContainer aSource);

standard set Value method: - checks for min and max limits - sets the current date when the value had changed last time - but only if SimModel was registered
public void setValue(FWSimVariable aVariable, FWSimFieldContainer aSource)
throws SimValueOutOfRangeException, SimLinkInvalidException;

standard set Value method: - checks for min and max limits - sets the current date when the value had changed last time - but only if SimModel was registered
public void addValue(Object aValue, FWSimFieldContainer aSource)
throws SimValueOutOfRangeException;

standard set Value method: - checks for min and max limits - sets the current date when the value had changed last time - but only if SimModel was registered
public void addValue(FWSimVariable aVariable, FWSimFieldContainer aSource)
throws SimValueOutOfRangeException;

standard set Value method: - checks for min and max limits - sets the current date when the value had changed last time - but only if SimModel was registered
public void multiplyValue(Number aValue, FWSimFieldContainer aSource)
throws SimValueOutOfRangeException;

standard set Value method: - checks for min and max limits - sets the current date when the value had changed last time - but only if SimModel was registered
public void setArrayValue(int aIndex, Number aValue, FWSimFieldContainer
aSource) throws SimValueOutOfRangeException, SimFieldTypeException;

special method for setting values to an array type variable
public String getName();


returns the name
public String getInternalName();


returns The Name of the Variable without the component Name
public String getUnit();


returns the unit
public String getFormat();


returns the format
public Object getFormatter();


returns the format
public String getStringUnit();


returns the unit
public Object getDefault();


returns the default
public String getRule();


returns the rule implemented in the variable
public Object evaluate(FWSimVarMap aVarMap);


returns the result of the rule implemented in the variable
public Object evaluate();


returns the result of the rule implemented in the variable
public String toString(); // Overrides java.lang.Object

public String getStringValue();


returns a fromatted string value
public String toShortString();


returns the name as short string
public String toDebugString();


returns long debugging string value with all content of the variable
public Element toXML();


returns the Element of the variable with all needed values
public String getFieldName();


returns the short name without container information
public Integer[] getCount();


returns the count of items in the array
public Integer[] setCount(int aCount);


returns the count of items in the array
public void setCount(Integer[] aArray);

public String getPrefix();


returns the matching prefix
public String addPrefix(String aFieldName);


returns the field name with matching prefix
public String check(FWSimVariable aOutputVar);

checking routine for 2 different SimVariables that are to be linked together
returns an error string - if string is null everything seems to be perfect!
public FWSimFieldContainer getSource();


returns the component registered as source component
public FWSimVarMap getVarMap();


returns the VarMap connected to this Variable
public void setSource(FWSimFieldContainer aComponent);

changing registered source component for this variable ! use this with care! should not be used by default
public void addOutputLink(String aFieldName) throws SimLinkInvalidException;

adding a link to the output-part of the link.
public void addInputLink(String aFieldName) throws SimLinkInvalidException;

adding a link to the output-part of the link.
public void removeLink(String aName);

public boolean isInputLinked() throws SimLinkInvalidException;


returns if is linked to another field as input
public boolean isOutputLinked();


returns if is linked to another field as output
public JexlRuleScript.COMPLEXITY getRuleComplexity();


returns the complexRule
public FWSimVariable clone(FWSimVarMap aVarMap);

deep clone of the SimVariable copying all fields to a new variable
returns a new cloned {@link FWSimVariable} with identical meta data
public FWSimVariable deepClone(FWSimVarMap aVarMap);


returns
public void setContentType(FWSimVariable.CONTENT_TYPE aContentType);

public void updateFields(Element aVarElement);

public Element getFormComponentXML();


returns the generated form xml
public boolean equals(Object aObj); // Overrides java.lang.Object

public String toHTMLTablestring();


returns the HTML Table String


// Inner Classes
public static final class FWSimVariable.CONTENT_TYPE extends java.lang.Enum
public static final class FWSimVariable.DATA_TYPE extends java.lang.Enum
public static final class FWSimVariable.MODE_TYPE extends java.lang.Enum
}



Extended by: FWSimCalibrationVariable



Passed to: FWSimVarMap.addLink(), addValue(), net.simplace.simulation.FWSimSolution.addVariable(), net.simplace.simulation.control.FWSimulationControlContainer.addVariable(), net.simplace.simulation.io.FWSimIOAdapter.addVariable(), net.simplace.simulation.io.FWSimCache.addVariable(), net.simplace.simulation.io.resources.FWSimResourceTransformer.addVariable(), net.simplace.simulation.io.resources.FWSimResourceCache.addVariable(), net.simplace.simulation.model.FWSimComponent.addVariable(), FWSimFieldContainerGroup.addVariable(), FWSimFieldContainer.addVariable(), FWSimVarMap.addVariable(), net.simplace.util.service.MathHelper.calulateLinearRegression(), check(), FWSimVarMap.checkInternal(), net.simplace.util.check.FWCheckHelper.checkLimits(), net.simplace.util.check.FWChecker.checkLimits(), net.simplace.util.check.DefaultChecker.checkLimits(), net.simplace.util.check.FWCheckHelper.checkSource(), net.simplace.util.check.FWChecker.checkSource(), net.simplace.util.check.DefaultChecker.checkSource(), net.simplace.util.check.FWCheckHelper.checkWriteProtectionOnContentType(), net.simplace.util.check.FWChecker.checkWriteProtectionOnContentType(), net.simplace.util.check.DefaultChecker.checkWriteProtectionOnContentType(), createFormElement(), createFormFields(), createMultipleFormElement(), FWSimCalibrationVariable.FWSimCalibrationVariable(), net.simplace.simulation.model.FWSimVarLink(), net.simplace.simulation.model.FWSimVarLink(), FWSimVarMap.initValue(), FWSimVarMap.removeLink(), setValue(), setValue(), setValueAndDefault(), net.simplace.simulation.graphpanel.SimVarLink(), net.simplace.simulation.graphpanel.SimVarLink(), net.simplace.util.service.StringHelper.transformDataType(), FWSimHelper.unzipArray(), updateFields(), FWSimHelper.zipArray()



Returned by: clone(), createOutputSimVariable(), createSimVariable(), createSimVariable(), deepClone(), net.simplace.simulation.graphpanel.SimVarLink.getDestField(), net.simplace.simulation.model.FWSimVarLink.getDestField(), net.simplace.simulation.control.FWSimulationControlCache.getIteration(), FWSimCalibrationVariable.getProperty(), net.simplace.simulation.control.FWSimulationControlCache.getSelectedSimulationsVar(), FWSimVarMap.getSimVariable(), net.simplace.simulation.wrapper.JavaSimplaceWrapper.getSimVariable(), net.simplace.simulation.graphpanel.SimVarLink.getSourceField(), net.simplace.simulation.model.FWSimVarLink.getSourceField(), net.simplace.simulation.FWSimSolution.getVariable(), net.simplace.simulation.control.FWSimulationControlContainer.getVariable(), net.simplace.simulation.io.FWSimIOAdapter.getVariable(), net.simplace.simulation.io.FWSimCache.getVariable(), net.simplace.simulation.io.resources.FWSimResourceTransformer.getVariable(), net.simplace.simulation.io.resources.FWSimResourceCache.getVariable(), net.simplace.simulation.model.FWSimComponent.getVariable(), FWSimFieldContainerGroup.getVariable(), FWSimFieldContainer.getVariable(), net.simplace.simulation.model.FWSimComponent.getVariableField(), updateFields()



Type of: net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector.cMode, net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector.cNumberOfVariables, net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector.ErrorMethod, net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector.ErrorValue, net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector.ErrorValues, net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector.NumberOfValues