Class CornerCases
java.lang.Object
edu.gvsu.kurmasz.warszawa.listgen.IntegerListGenerator
edu.gvsu.kurmasz.warszawa.listgen.ExponentialCornerCases
edu.gvsu.kurmasz.warszawa.listgen.CornerCases
public class CornerCases extends ExponentialCornerCases
Generate lists of integers that represent values surrounding powers of 2.
(These are often "corner cases" when testing circuits.) This class is similar
to
ExponentialCornerCases
; however, the parameters refer to the
precise desired maximum and minimum value.- Author:
- Zachary Kurmas
-
Constructor Summary
Constructors Constructor Description CornerCases()
-
Method Summary
Modifier and Type Method Description long[]
generateLongArray(long min, long max, long step)
Generate an array oflong
integers containing the values surrounding powers of two.Methods inherited from class edu.gvsu.kurmasz.warszawa.listgen.IntegerListGenerator
generateIntArray, generateIntList, generateLongList
-
Constructor Details
-
CornerCases
public CornerCases()
-
-
Method Details
-
generateLongArray
public long[] generateLongArray(long min, long max, long step)Generate an array oflong
integers containing the values surrounding powers of two. For this class, the user specifically lists the values at which the sequence is to begin and end. In addition to the beginning and ending values, the list includes all integers of the form(2^i)-1
,2^i
, and(2^i)+1
that are between the beginning and ending values. (Compare toExponentialCornerCases
.)- Overrides:
generateLongArray
in classExponentialCornerCases
- Parameters:
min
- the minimum value to appear in the list.max
- the maximum value to appear in the list. (Must be ≥min
.)step
- the value by which the implicit exponent is incremented. Must be>= 1
.- Returns:
- an array of long integers.
- Throws:
java.lang.IllegalArgumentException
- if the parameters specify a list that is too long to fit in a Java array.
-