java.lang.Object
app.valuationcontrol.multimodule.library.xlhandler.XLInstance
All Implemented Interfaces:
ScenarioDataProvider

public class XLInstance extends Object implements ScenarioDataProvider
  • Field Details

  • Constructor Details

    • XLInstance

      public XLInstance(Model attachedModel, CalcDocument calcDocument, boolean preloadModel)
      Create a new instance of an Excel calculation for a model
      Parameters:
      attachedModel - the model to be loaded
      calcDocument - the reference to the calculation document
      preloadModel - indicates whether the model should be preloaded
  • Method Details

    • saveAs

      public InputStream saveAs()
      Specified by:
      saveAs in interface ScenarioDataProvider
    • reloadAndUpdateClients

      public void reloadAndUpdateClients()
      Specified by:
      reloadAndUpdateClients in interface ScenarioDataProvider
    • setSingleValue

      public void setSingleValue(VariableValue variableValue)
      Loads data from VariableValue and override manually the formula for a single variable value Also applied for historical values
    • runSensitivities

      public void runSensitivities(List<Sensitivity> sensitivities, SCENARIO scenario)
      Specified by:
      runSensitivities in interface ScenarioDataProvider
    • updateCacheValues

      public void updateCacheValues(SCENARIO scenario)
    • getContent

      public CalculationData getContent(SCENARIO scenario)
      Specified by:
      getContent in interface ScenarioDataProvider
      Returns:
      the content of the XL file for a certain scenario
    • generateVariableArray

      public String[] generateVariableArray(Variable variable)
      Generates an array containing the metadata, the historical and projection values, including the variableValues
      Parameters:
      variable - the variable to generate array for
      Returns:
      an array containing all calculates values without variable values
    • cleanAndUpdateAdditionalSheets

      public void cleanAndUpdateAdditionalSheets()
      Removes all sheets apart from the "main" sheet (renamed in the constructor of this class)
    • refreshValue

      public void refreshValue(Variable myVariable, VariableValue myVariableValue)
      Use this function to refresh a single variableValue (efficiency optimization)
      Specified by:
      refreshValue in interface ScenarioDataProvider
    • reloadVariableAndUpdateCache

      public void reloadVariableAndUpdateCache(Variable variable)
      Specified by:
      reloadVariableAndUpdateCache in interface ScenarioDataProvider
    • reloadWholeBaseContentIfNoCache

      public void reloadWholeBaseContentIfNoCache()
      Use this function to refresh the content Loads the metadata and the variable logic which is replicated for each segment (including "main" segment)

      return list of open sheets before reload

    • createPrettyContent

      public void createPrettyContent()
      Create an Excel file formatted as a financial model with areas as tabs
    • setAttachedModel

      public void setAttachedModel(Model attachedModel)
    • isUnusedFor

      public boolean isUnusedFor(Duration inactivityThreshold)
      Specified by:
      isUnusedFor in interface ScenarioDataProvider
    • sleep

      public void sleep()
      Specified by:
      sleep in interface ScenarioDataProvider
    • clearCacheAndReloadAndUpdateClients

      public void clearCacheAndReloadAndUpdateClients()
      Specified by:
      clearCacheAndReloadAndUpdateClients in interface ScenarioDataProvider