Package org.apache.commons.math.exception

Examples of org.apache.commons.math.exception.NotPositiveException


        if (values == null) {
            throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY);
        }

        if (begin < 0) {
            throw new NotPositiveException(LocalizedFormats.START_POSITION, begin);
        }

        if (length < 0) {
            throw new NotPositiveException(LocalizedFormats.LENGTH, length);
        }

        if (begin + length > values.length) {
            throw MathRuntimeException.createIllegalArgumentException(
                  LocalizedFormats.SUBARRAY_ENDS_AFTER_ARRAY_END);
View Full Code Here


        if (chromosomes.size() > populationLimit) {
            throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE,
                                                chromosomes.size(), populationLimit, false);
        }
        if (populationLimit < 0) {
            throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit);
        }

        this.chromosomes = chromosomes;
        this.populationLimit = populationLimit;
    }
View Full Code Here

     *
     * @param populationLimit maximal size of the population
     */
    public ListPopulation (int populationLimit) {
        if (populationLimit < 0) {
            throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit);
        }
        this.populationLimit = populationLimit;
        this.chromosomes = new ArrayList<Chromosome>(populationLimit);
    }
View Full Code Here

     * factor.
     * @throws NotPositiveException if {@code exponent < 0}.
     */
    public void setBrightnessExponent(final int exponent) {
        if (exponent < 0) {
            throw new NotPositiveException(exponent);
        }
        brightnessExponent = exponent;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math.exception.NotPositiveException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.