Class IntSubExceptionGenerator
- java.lang.Object
-
- ru.ispras.testbase.knowledge.integer.IntExceptionGenerator
-
- ru.ispras.testbase.knowledge.integer.sub.IntSubExceptionGenerator
-
- All Implemented Interfaces:
Generator<IntNumber,IntException>
public final class IntSubExceptionGenerator extends IntExceptionGenerator
IntSubExceptionGenerator
implements a random generator targeted at the integer subtraction exceptions.
-
-
Constructor Summary
Constructors Constructor Description IntSubExceptionGenerator(IntFormat format)
Constructs a random generator targeted at the integer addition exceptions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkNormal(IntNumber[] operands)
Checks whether the operation does not cause exceptions.boolean
checkOverflow(IntNumber[] operands)
Checks whether the operation causes the overflow exception.GeneratorResult<IntNumber>
generateNormal(IntNumber[] operands)
Tries to generate operands that do not cause exceptions.GeneratorResult<IntNumber>
generateOverflow(IntNumber[] operands)
Tries to generate operands that cause the overflow exception.-
Methods inherited from class ru.ispras.testbase.knowledge.integer.IntExceptionGenerator
check, generate
-
-
-
-
Constructor Detail
-
IntSubExceptionGenerator
public IntSubExceptionGenerator(IntFormat format)
Constructs a random generator targeted at the integer addition exceptions.- Parameters:
format
- the operand format.
-
-
Method Detail
-
checkNormal
public boolean checkNormal(IntNumber[] operands)
Description copied from class:IntExceptionGenerator
Checks whether the operation does not cause exceptions.- Specified by:
checkNormal
in classIntExceptionGenerator
- Parameters:
operands
- the operation operands.- Returns:
true
if the operation does not cause exceptions;false
otherwise.
-
generateNormal
public GeneratorResult<IntNumber> generateNormal(IntNumber[] operands)
Description copied from class:IntExceptionGenerator
Tries to generate operands that do not cause exceptions.- Specified by:
generateNormal
in classIntExceptionGenerator
- Parameters:
operands
- the operation operands (operand[i] == null
if the i-th operation is not fixed; otherwiseoperand[i]
contains the operand value).- Returns:
- the operation operands.
-
checkOverflow
public boolean checkOverflow(IntNumber[] operands)
Description copied from class:IntExceptionGenerator
Checks whether the operation causes the overflow exception.- Specified by:
checkOverflow
in classIntExceptionGenerator
- Parameters:
operands
- the operation operands.- Returns:
true
if the operation causes the exception;false
otherwise.
-
generateOverflow
public GeneratorResult<IntNumber> generateOverflow(IntNumber[] operands)
Description copied from class:IntExceptionGenerator
Tries to generate operands that cause the overflow exception.- Specified by:
generateOverflow
in classIntExceptionGenerator
- Parameters:
operands
- the operation operands (operand[i] == null
if the i-th operation is not fixed; otherwiseoperand[i]
contains the operand value).- Returns:
- the operation operands.
-
-