Class 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 of long integers containing the values surrounding powers of two.

    Methods inherited from class edu.gvsu.kurmasz.warszawa.listgen.IntegerListGenerator

    generateIntArray, generateIntList, generateLongList

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • generateLongArray

      public long[] generateLongArray​(long min, long max, long step)
      Generate an array of long 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 to ExponentialCornerCases.)
      Overrides:
      generateLongArray in class ExponentialCornerCases
      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.