Class ConditionDependencyGraph.OrderConstraints
java.lang.Object
software.amazon.smithy.rulesengine.logic.cfg.ConditionDependencyGraph.OrderConstraints
- Enclosing class:
- ConditionDependencyGraph
Order-specific constraints for a particular condition ordering.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canMove
(int from, int to) Checks if moving a condition from one position to another would violate dependencies.int
getMaxValidPosition
(int positionIndex) Gets the maximum valid position for a condition.int
getMinValidPosition
(int positionIndex) Gets the minimum valid position for a condition.
-
Method Details
-
canMove
public boolean canMove(int from, int to) Checks if moving a condition from one position to another would violate dependencies.- Parameters:
from
- current positionto
- target position- Returns:
- true if the move is valid
-
getMinValidPosition
public int getMinValidPosition(int positionIndex) Gets the minimum valid position for a condition.- Parameters:
positionIndex
- the position index in the ordering- Returns:
- the minimum position where this condition can be placed
-
getMaxValidPosition
public int getMaxValidPosition(int positionIndex) Gets the maximum valid position for a condition.- Parameters:
positionIndex
- the position index in the ordering- Returns:
- the maximum position where this condition can be placed
-