Changeset 107 for trunk/EventBenchCore


Ignore:
Timestamp:
07/05/11 15:24:58 (13 years ago)
Author:
sherbold
Message:
  • added checks for the correctness of constructor parameter values
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java

    r106 r107  
    11package de.ugoe.cs.eventbench.coverage; 
    22 
     3import java.security.InvalidParameterException; 
    34import java.util.Collection; 
    45import java.util.LinkedHashMap; 
     
    7576         *  
    7677         * @param process 
    77          *            stochastic process used for coverage calculations; if it is 
    78          *            zero, not all calculations are possible 
     78         *            stochastic process used for coverage calculations; must not be null 
    7979         * @param sequences 
    8080         *            sequences for which the coverage is calculated; must not be 
    81          *            null. 
     81         *            null 
    8282         * @param length 
    8383         *            length of the subsequences for which the coverage is analyzed; 
     
    8686        public CoverageCalculator(IStochasticProcess process, 
    8787                        Collection<List<? extends Event<?>>> sequences, int length) { 
    88                 // TODO check parameters 
     88                if( process==null ) { 
     89                        throw new InvalidParameterException("process must not be null"); 
     90                } 
     91                if( sequences==null ) { 
     92                        throw new InvalidParameterException("sequences must not be null"); 
     93                } 
     94                if( length<=0 ) { 
     95                        throw new InvalidParameterException("length must be >0; actual value: " + length); 
     96                } 
    8997                this.process = process; 
    9098                this.sequences = sequences; 
Note: See TracChangeset for help on using the changeset viewer.