Class FWSimVarLink

java.lang.Object
net.simplace.sim.model.FWSimVarLink

public class FWSimVarLink extends Object
A link from a source variable to a destination variable, or a fixed value for a destination variable. Links can be defined by names and resolved later against a var map (see initialize(FWSimVarMap)).
Author:
Andreas Enders
  • Constructor Details

    • FWSimVarLink

      public FWSimVarLink(FWSimVariable<?> aSourceField, FWSimVariable<?> aDestField)
      Creates a link between two variables.
      Parameters:
      aSourceField - source variable
      aDestField - destination variable
    • FWSimVarLink

      public FWSimVarLink(String aSourceFieldName, String aDestFieldName)
      Creates a link by variable names; the variables are resolved by initialize(FWSimVarMap).
      Parameters:
      aSourceFieldName - name of the source variable
      aDestFieldName - name of the destination variable
    • FWSimVarLink

      public FWSimVarLink(FWSimVariable<?> aDestField, Object aValue)
      Creates a link that sets a fixed value for a destination variable (no source variable). Note that the destination name is not stored, so initialize(FWSimVarMap) cannot be used for such a link.
      Parameters:
      aDestField - destination variable
      aValue - the value
  • Method Details

    • getValue

      public Object getValue()
      Returns:
      the fixed value, or null for links between variables
    • initialize

      public void initialize(FWSimVarMap aVarMap)
      Resolves the source (if named) and destination variables from a var map.
      Parameters:
      aVarMap - var map containing the variables
    • setValue

      public void setValue(Object aValue)
      Parameters:
      aValue - the fixed value to set
    • getSourceField

      public FWSimVariable<?> getSourceField()
      Returns:
      the sourceField
    • getSourceFieldName

      public String getSourceFieldName()
      Returns:
      the sourceFieldName
    • getDestFieldName

      public String getDestFieldName()
      Returns:
      the destFieldName
    • getDestField

      public FWSimVariable<?> getDestField()
      Returns:
      the destField