Package io.keikai.model
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 TypeMethodDescriptionaddInputCell(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.getName()Returns the name of this scenario.getUser()Returns the user who created or last modified this scenario.booleanisHidden()Returns whether this scenario is hidden from the user.booleanisLocked()Returns whether this scenario is locked (cannot be modified when sheet is protected).voidsetComment(String comment) Sets the comment/description of this scenario.voidsetHidden(boolean hidden) Sets whether this scenario is hidden from the user.voidsetLocked(boolean locked) Sets whether this scenario is locked.voidSets the name of this scenario.voidSets 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
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
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
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
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
-