Interface SScenario

All Known Implementing Classes:
ScenarioImpl

public interface SScenario
Represents a scenario in Excel's What-If Analysis feature. A scenario is a named set of input values that can be applied to specific cells.
Since:
7.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    addInputCell(int row, int col, String value)
    Adds an input cell to this scenario.
    Returns the comment/description of this scenario.
    Returns the list of input cells for this scenario.
    Returns the name of this scenario.
    Returns the user who created or last modified this scenario.
    boolean
    Returns whether this scenario is hidden from the user.
    boolean
    Returns whether this scenario is locked (cannot be modified when sheet is protected).
    void
    setComment(String comment)
    Sets the comment/description of this scenario.
    void
    setHidden(boolean hidden)
    Sets whether this scenario is hidden from the user.
    void
    setLocked(boolean locked)
    Sets whether this scenario is locked.
    void
    Sets the name of this scenario.
    void
    Sets the user who created or last modified this scenario.
  • Method Details

    • getName

      String getName()
      Returns the name of this scenario.
      Returns:
      the scenario name
    • setName

      void setName(String name)
      Sets the name of this scenario.
      Parameters:
      name - the scenario name
    • getComment

      String getComment()
      Returns the comment/description of this scenario.
      Returns:
      the comment, or null if not set
    • setComment

      void setComment(String comment)
      Sets the comment/description of this scenario.
      Parameters:
      comment - the comment text
    • getUser

      String getUser()
      Returns the user who created or last modified this scenario.
      Returns:
      the user name, or null if not set
    • setUser

      void setUser(String user)
      Sets the user who created or last modified this scenario.
      Parameters:
      user - the user name
    • isHidden

      boolean isHidden()
      Returns whether this scenario is hidden from the user.
      Returns:
      true if hidden
    • setHidden

      void setHidden(boolean hidden)
      Sets whether this scenario is hidden from the user.
      Parameters:
      hidden - true to hide
    • isLocked

      boolean isLocked()
      Returns whether this scenario is locked (cannot be modified when sheet is protected).
      Returns:
      true if locked
    • setLocked

      void setLocked(boolean locked)
      Sets whether this scenario is locked.
      Parameters:
      locked - true to lock
    • getInputCells

      List<SScenarioInputCell> getInputCells()
      Returns the list of input cells for this scenario.
      Returns:
      list of input cells
    • addInputCell

      SScenarioInputCell addInputCell(int row, int col, String value)
      Adds an input cell to this scenario.
      Parameters:
      row - the row index (0-based)
      col - the column index (0-based)
      value - the scenario value for this cell
      Returns:
      the newly created input cell