本文整理汇总了Java中org.apache.commons.math3.util.MathArrays.OrderDirection方法的典型用法代码示例。如果您正苦于以下问题:Java MathArrays.OrderDirection方法的具体用法?Java MathArrays.OrderDirection怎么用?Java MathArrays.OrderDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.math3.util.MathArrays
的用法示例。
在下文中一共展示了MathArrays.OrderDirection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NonMonotonicSequenceException
import org.apache.commons.math3.util.MathArrays; //导入方法依赖的package包/类
/**
* Construct the exception.
*
* @param wrong Value that did not match the requirements.
* @param previous Previous value in the sequence.
* @param index Index of the value that did not match the requirements.
* @param direction Strictly positive for a sequence required to be
* increasing, negative (or zero) for a decreasing sequence.
* @param strict Whether the sequence must be strictly increasing or
* decreasing.
*/
public NonMonotonicSequenceException(Number wrong,
Number previous,
int index,
MathArrays.OrderDirection direction,
boolean strict) {
super(direction == MathArrays.OrderDirection.INCREASING ?
(strict ?
LocalizedFormats.NOT_STRICTLY_INCREASING_SEQUENCE :
LocalizedFormats.NOT_INCREASING_SEQUENCE) :
(strict ?
LocalizedFormats.NOT_STRICTLY_DECREASING_SEQUENCE :
LocalizedFormats.NOT_DECREASING_SEQUENCE),
wrong, previous, Integer.valueOf(index), Integer.valueOf(index - 1));
this.direction = direction;
this.strict = strict;
this.index = index;
this.previous = previous;
}
示例2: NonMonotonicSequenceException
import org.apache.commons.math3.util.MathArrays; //导入方法依赖的package包/类
/**
* Construct the exception.
*
* @param wrong Value that did not match the requirements.
* @param previous Previous value in the sequence.
* @param index Index of the value that did not match the requirements.
* @param direction Strictly positive for a sequence required to be
* increasing, negative (or zero) for a decreasing sequence.
* @param strict Whether the sequence must be strictly increasing or
* decreasing.
*/
public NonMonotonicSequenceException(Number wrong,
Number previous,
int index,
MathArrays.OrderDirection direction,
boolean strict) {
super(direction == MathArrays.OrderDirection.INCREASING ?
(strict ?
LocalizedFormats.NOT_STRICTLY_INCREASING_SEQUENCE :
LocalizedFormats.NOT_INCREASING_SEQUENCE) :
(strict ?
LocalizedFormats.NOT_STRICTLY_DECREASING_SEQUENCE :
LocalizedFormats.NOT_DECREASING_SEQUENCE),
wrong, previous, index, index - 1);
this.direction = direction;
this.strict = strict;
this.index = index;
this.previous = previous;
}
示例3: getDirection
import org.apache.commons.math3.util.MathArrays; //导入方法依赖的package包/类
/**
* @return the order direction.
**/
public MathArrays.OrderDirection getDirection() {
return direction;
}