Example usage for org.apache.commons.math3.exception.util LocalizedFormats NULL_NOT_ALLOWED

List of usage examples for org.apache.commons.math3.exception.util LocalizedFormats NULL_NOT_ALLOWED

Introduction

In this page you can find the example usage for org.apache.commons.math3.exception.util LocalizedFormats NULL_NOT_ALLOWED.

Prototype

LocalizedFormats NULL_NOT_ALLOWED

To view the source code for org.apache.commons.math3.exception.util LocalizedFormats NULL_NOT_ALLOWED.

Click Source Link

Usage

From source file:com.juliazozulia.wordusage.Utils.Frequency.java

/**
 * Merge another Frequency object's counts into this instance.
 * This Frequency's counts will be incremented (or set when not already set)
 * by the counts represented by other./*  w  ww. j  a  v a  2 s.  com*/
 *
 * @param other the other {@link Frequency} object to be merged
 * @throws NullArgumentException if {@code other} is null
 * @since 3.1
 */
public void merge(final Frequency other) throws NullArgumentException {
    MathUtils.checkNotNull(other, LocalizedFormats.NULL_NOT_ALLOWED);

    final Iterator<Entry<String, Integer>> iter = other.entrySetIterator();
    while (iter.hasNext()) {
        final Entry<String, Integer> entry = iter.next();
        incrementValue(entry.getKey(), entry.getValue());
    }
}

From source file:com.juliazozulia.wordusage.Utils.Frequency.java

/**
 * Merge a {@link Collection} of {@link Frequency} objects into this instance.
 * This Frequency's counts will be incremented (or set when not already set)
 * by the counts represented by each of the others.
 *
 * @param others the other {@link Frequency} objects to be merged
 * @throws NullArgumentException if the collection is null
 * @since 3.1/*from  w  ww.  java  2  s  . c  om*/
 */
public void merge(final Collection<Frequency> others) throws NullArgumentException {
    MathUtils.checkNotNull(others, LocalizedFormats.NULL_NOT_ALLOWED);

    for (final Frequency freq : others) {
        merge(freq);
    }
}

From source file:cz.cuni.mff.spl.evaluator.statistics.KolmogorovSmirnovTestFlag.java

/**
 * Verifies that {@code array} has length at least 2.
 *
 * @param array array to test/*from w  w  w  .ja  v a2  s .co  m*/
 * @throws NullArgumentException if array is null
 * @throws InsufficientDataException if array is too short
 */
private void checkArray(double[] array) {
    if (array == null) {
        throw new NullArgumentException(LocalizedFormats.NULL_NOT_ALLOWED);
    }
    if (array.length < 2) {
        throw new InsufficientDataException(LocalizedFormats.INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE,
                array.length, 2);
    }
}