Example usage for org.apache.commons.lang Validate notNull

List of usage examples for org.apache.commons.lang Validate notNull

Introduction

In this page you can find the example usage for org.apache.commons.lang Validate notNull.

Prototype

public static void notNull(Object object) 

Source Link

Document

Validate an argument, throwing IllegalArgumentException if the argument is null.

 Validate.notNull(myObject); 

The message in the exception is 'The validated object is null'.

Usage

From source file:com.opengamma.analytics.math.statistics.distribution.StudentTTwoTailedCriticalValueCalculator.java

public StudentTTwoTailedCriticalValueCalculator(final double nu, final RandomEngine engine) {
    ArgumentChecker.notNegative(nu, "nu");
    Validate.notNull(engine);
    _calc = new StudentTOneTailedCriticalValueCalculator(nu, engine);
}

From source file:com.opengamma.analytics.math.rootfinding.newton.BroydenMatrixUpdateFunction.java

@Override
public DoubleMatrix2D getUpdatedMatrix(final Function1D<DoubleMatrix1D, DoubleMatrix2D> j, DoubleMatrix1D x,
        final DoubleMatrix1D deltaX, final DoubleMatrix1D deltaY, final DoubleMatrix2D matrix) {
    Validate.notNull(deltaX);
    Validate.notNull(deltaY);//from w  w  w . ja v  a  2s .  co  m
    Validate.notNull(matrix);
    final double length2 = OG_ALGEBRA.getInnerProduct(deltaX, deltaX);
    if (length2 == 0.0) {
        return matrix;
    }
    Matrix<?> temp = OG_ALGEBRA.subtract(deltaY, OG_ALGEBRA.multiply(matrix, deltaX));
    temp = OG_ALGEBRA.scale(temp, 1.0 / length2);
    return (DoubleMatrix2D) OG_ALGEBRA.add(matrix, OG_ALGEBRA.getOuterProduct(temp, deltaX));
}

From source file:com.opengamma.analytics.math.rootfinding.newton.InverseJacobianEstimateInitializationFunction.java

public InverseJacobianEstimateInitializationFunction(final Decomposition<?> decomposition) {
    Validate.notNull(decomposition);
    _decomposition = decomposition;
}

From source file:com.opengamma.analytics.financial.model.stochastic.BlackScholesGeometricBrownianMotionProcess.java

@Override
public Function1D<Double, Double> getPathGeneratingFunction(final T t, final U u, final int steps) {
    Validate.notNull(t);
    Validate.notNull(u);//from   w w  w .ja va 2 s . com
    if (steps < 1) {
        throw new IllegalArgumentException("Number of steps must be greater than zero");
    }
    final double k = t.getStrike();
    final double m = t.getTimeToExpiry(u.getDate());
    final double sigma = u.getVolatility(m, k);
    final double b = u.getCostOfCarry();
    final double dt = m / steps;
    final double sigmaSq = sigma * sigma;
    final double nu = dt * (b - 0.5 * sigmaSq);
    final double sigmaDt = sigma * Math.sqrt(dt);
    return new Function1D<Double, Double>() {

        @Override
        public Double evaluate(final Double e) {
            return nu + sigmaDt * e;
        }
    };
}

From source file:com.opengamma.analytics.financial.model.stochastic.BlackScholesArithmeticBrownianMotionProcess.java

@Override
public Function1D<Double, Double> getPathGeneratingFunction(final T t, final U u, final int steps) {
    Validate.notNull(t);
    Validate.notNull(u);/*from  w  w w. j  a  v a 2  s . co  m*/
    if (steps < 1) {
        throw new IllegalArgumentException("Number of steps must be greater than zero");
    }
    final double k = t.getStrike();
    final double m = t.getTimeToExpiry(u.getDate());
    final double sigma = u.getVolatility(m, k);
    final double b = u.getCostOfCarry();
    final double dt = m / steps;
    final double sigmaSq = sigma * sigma;
    final double nu = dt * (b - 0.5 * sigmaSq);
    final double sigmaDt = sigma * Math.sqrt(dt);
    return new Function1D<Double, Double>() {

        @Override
        public Double evaluate(final Double e) {
            return Math.exp(nu + sigmaDt * e);
        }
    };
}

From source file:com.opengamma.analytics.financial.var.parametric.DeltaGammaCovarianceMatrixSkewnessCalculator.java

public DeltaGammaCovarianceMatrixSkewnessCalculator(final MatrixAlgebra algebra) {
    Validate.notNull(algebra);
    _algebra = algebra;
}

From source file:com.opengamma.analytics.math.statistics.distribution.StudentTOneTailedCriticalValueCalculator.java

public StudentTOneTailedCriticalValueCalculator(final double nu, final RandomEngine engine) {
    ArgumentChecker.notNegative(nu, "nu");
    Validate.notNull(null);
    _dist = new StudentTDistribution(nu, engine);
}

From source file:com.useekm.fulltext.AbstractUnary.java

protected AbstractUnary(FulltextSearch arg) {
    Validate.notNull(arg);
    this.arg = arg;
}

From source file:com.opengamma.analytics.math.rootfinding.newton.JacobianDirectionFunction.java

@Override
public DoubleMatrix1D getDirection(final DoubleMatrix2D estimate, final DoubleMatrix1D y) {
    Validate.notNull(estimate);
    Validate.notNull(y);/*from   ww w  .j a  v  a 2 s  .  c  o  m*/
    final DecompositionResult result = _decomposition.evaluate(estimate);
    return result.solve(y);
}

From source file:com.opengamma.analytics.financial.var.parametric.DeltaGammaCovarianceMatrixStandardDeviationCalculator.java

public DeltaGammaCovarianceMatrixStandardDeviationCalculator(final MatrixAlgebra algebra) {
    Validate.notNull(algebra);
    _algebra = algebra;
}