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)
- aVarElement
- aFWSimFieldContainer
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
- aObject
value
- aSimVariable
to which the value is to be set
- aSourceComponent
Component who wants to set this value - for checking purpose
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
- aObject
value
- aSimVariable
to which the value is to be set
- aSourceComponent
Component who wants to set this value - for checking purpose
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 Element
createFormFields(
FWSimVariable aVariable,
FWSimVariable.CONTENT_TYPE aComponentContentType, String aDescription,
String aFrequence, String aVisible, String aEnabled, boolean
aMultipleVarType);
- aVariable
- aComponentContentType
- aDescription
- aFrequence
- aVisible
- aEnabled
- aMultipleVarType
returns the FormElement
public static Element
createFormFields(String aName, String aDescription,
String aContentTypeDefault, String aVisible, String aEnabled,
FWSimVariable.CONTENT_TYPE aComponentContentType);
- aName
- aDescription
- aContentTypeDefault
- aVisible
- aEnabled
- 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);
- aVariable
- aName
- aDescription
- aVisible
- aEnabled
- aContentType
- tModeType
- aModeNeeded
- aFrequence
- tDataType
- tUnit
- tMax
- tMin
- tRule
- tDesc
- tDefault
- 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);
- aVariable
- aName
- aDescription
- aVisible
- aEnabled
- aContentType
- aModeType
- aModeNeeded
- tDataType
- tUnit
- tMax
- tMin
- tRule
- tDesc
- tDefault
- aComponentContentType
returns the Form Element
// 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 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 !!!
- aDefault
- taken if conversion is not successful
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
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
- aSource
Component who wants to set this value - for checking purpose
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
- aValue
the value to set
- aSource
Component who wants to set this value - for checking purpose
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
- aValue
the value to set
- aSource
Component who wants to set this value - for checking purpose
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
- aVariable
the value to set
- aSource
Component who wants to set this value - for checking purpose
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
- aValue
the value to set
- aSource
Component who wants to set this value - for checking purpose
public void
setArrayValue(int aIndex, Number aValue,
FWSimFieldContainer aSource) throws
SimValueOutOfRangeException,
SimFieldTypeException;
special method for setting values to an array type variable
- aIndex
of the array value should be set to
- aValue
the value to set
- aSource
Component who wants to set this value - for checking purpose
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);
- aCount
count of the params
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
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 isOutputLinked();
returns if is linked to another field as output
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 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(), 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