Package ru.ispras.fortress.solver
Class SolverResultBuilder
- java.lang.Object
-
- ru.ispras.fortress.solver.SolverResultBuilder
-
public final class SolverResultBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SolverResultBuilder(SolverResult.Status status)
Constructs a SolverResultBuilder object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(java.lang.String error)
Adds an error description to the list of errors.void
addVariable(Variable variable)
Adds a variable to the list of variables.SolverResult
build()
Creates a solver result object basing attributes hold by the builder.boolean
hasErrors()
Checks whether any errors have been registered.void
setStatus(SolverResult.Status status)
Sets the status of the result.
-
-
-
Constructor Detail
-
SolverResultBuilder
public SolverResultBuilder(SolverResult.Status status)
Constructs a SolverResultBuilder object.- Parameters:
status
- The initial status of the result.
-
-
Method Detail
-
build
public SolverResult build()
Creates a solver result object basing attributes hold by the builder.- Returns:
- A new solver result object.
-
setStatus
public void setStatus(SolverResult.Status status)
Sets the status of the result.- Parameters:
status
- Result status.
-
addError
public void addError(java.lang.String error)
Adds an error description to the list of errors.- Parameters:
error
- An error description.
-
addVariable
public void addVariable(Variable variable)
Adds a variable to the list of variables.- Parameters:
variable
- A variable object.
-
hasErrors
public boolean hasErrors()
Checks whether any errors have been registered.- Returns:
true
if any errors have been reported orfalse
otherwise.
-
-