Java Code Examples for org.apache.commons.math.util.MathUtils#OrderDirection

The following examples show how to use org.apache.commons.math.util.MathUtils#OrderDirection . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 NonMonotonousSequenceException(Number wrong,
                                      Number previous,
                                      int index,
                                      MathUtils.OrderDirection direction,
                                      boolean strict) {
    super(direction == MathUtils.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;
}
 
Example 2
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 NonMonotonousSequenceException(Number wrong,
                                      Number previous,
                                      int index,
                                      MathUtils.OrderDirection direction,
                                      boolean strict) {
    super(direction == MathUtils.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;
}
 
Example 3
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 NonMonotonousSequenceException(Number wrong,
                                      Number previous,
                                      int index,
                                      MathUtils.OrderDirection direction,
                                      boolean strict) {
    super(direction == MathUtils.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;
}
 
Example 4
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 NonMonotonousSequenceException(Number wrong,
                                      Number previous,
                                      int index,
                                      MathUtils.OrderDirection direction,
                                      boolean strict) {
    super(direction == MathUtils.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;
}
 
Example 5
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return the order direction.
 **/
public MathUtils.OrderDirection getDirection() {
    return direction;
}
 
Example 6
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return the order direction.
 **/
public MathUtils.OrderDirection getDirection() {
    return direction;
}
 
Example 7
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return the order direction.
 **/
public MathUtils.OrderDirection getDirection() {
    return direction;
}
 
Example 8
Source File: NonMonotonousSequenceException.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return the order direction.
 **/
public MathUtils.OrderDirection getDirection() {
    return direction;
}