本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.OUT_OF_RANGE_SIMPLE属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.OUT_OF_RANGE_SIMPLE属性的具体用法?Java LocalizedFormats.OUT_OF_RANGE_SIMPLE怎么用?Java LocalizedFormats.OUT_OF_RANGE_SIMPLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.math3.exception.util.LocalizedFormats
的用法示例。
在下文中一共展示了LocalizedFormats.OUT_OF_RANGE_SIMPLE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkValidity
/**
* {@inheritDoc}
*/
@Override
protected void checkValidity(final List<Double> chromosomeRepresentation)
throws InvalidRepresentationException {
for (double val : chromosomeRepresentation) {
if (val < 0 || val > 1) {
throw new InvalidRepresentationException(LocalizedFormats.OUT_OF_RANGE_SIMPLE,
val, 0, 1);
}
}
}
示例2: StableRandomGenerator
/**
* Create a new generator.
*
* @param generator underlying random generator to use
* @param alpha Stability parameter. Must be in range (0, 2]
* @param beta Skewness parameter. Must be in range [-1, 1]
* @throws NullArgumentException if generator is null
* @throws OutOfRangeException if {@code alpha <= 0} or {@code alpha > 2}
* or {@code beta < -1} or {@code beta > 1}
*/
public StableRandomGenerator(final RandomGenerator generator,
final double alpha, final double beta)
throws NullArgumentException, OutOfRangeException {
if (generator == null) {
throw new NullArgumentException();
}
if (!(alpha > 0d && alpha <= 2d)) {
throw new OutOfRangeException(LocalizedFormats.OUT_OF_RANGE_LEFT,
alpha, 0, 2);
}
if (!(beta >= -1d && beta <= 1d)) {
throw new OutOfRangeException(LocalizedFormats.OUT_OF_RANGE_SIMPLE,
beta, -1, 1);
}
this.generator = generator;
this.alpha = alpha;
this.beta = beta;
if (alpha < 2d && beta != 0d) {
zeta = beta * FastMath.tan(FastMath.PI * alpha / 2);
} else {
zeta = 0d;
}
}
示例3: OutOfRangeException
/**
* Construct an exception from the mismatched dimensions.
*
* @param wrong Requested value.
* @param lo Lower bound.
* @param hi Higher bound.
*/
public OutOfRangeException(Number wrong,
Number lo,
Number hi) {
this(LocalizedFormats.OUT_OF_RANGE_SIMPLE, wrong, lo, hi);
}