当前位置: 首页>>代码示例>>Java>>正文


Java MathRuntimeException.createParseException方法代码示例

本文整理汇总了Java中org.apache.commons.math.MathRuntimeException.createParseException方法的典型用法代码示例。如果您正苦于以下问题:Java MathRuntimeException.createParseException方法的具体用法?Java MathRuntimeException.createParseException怎么用?Java MathRuntimeException.createParseException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math.MathRuntimeException的用法示例。


在下文中一共展示了MathRuntimeException.createParseException方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parse

import org.apache.commons.math.MathRuntimeException; //导入方法依赖的package包/类
/**
 * Parses a string to produce a {@link Vector3D} object.
 * @param source the string to parse
 * @return the parsed {@link Vector3D} object.
 * @exception ParseException if the beginning of the specified string
 *            cannot be parsed.
 */
public Vector3D parse(String source) throws ParseException {
    ParsePosition parsePosition = new ParsePosition(0);
    Vector3D result = parse(source, parsePosition);
    if (parsePosition.getIndex() == 0) {
        throw MathRuntimeException.createParseException(
                parsePosition.getErrorIndex(),
                "unparseable 3D vector: \"{0}\"", source);
    }
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:18,代码来源:Vector3DFormat.java

示例2: parse

import org.apache.commons.math.MathRuntimeException; //导入方法依赖的package包/类
/**
 * Parses a string to produce a {@link Fraction} object.
 * @param source the string to parse
 * @return the parsed {@link Fraction} object.
 * @exception ParseException if the beginning of the specified string
 *            cannot be parsed.
 */
@Override
public Fraction parse(final String source) throws ParseException {
    final ParsePosition parsePosition = new ParsePosition(0);
    final Fraction result = parse(source, parsePosition);
    if (parsePosition.getIndex() == 0) {
        throw MathRuntimeException.createParseException(
                parsePosition.getErrorIndex(),
                "unparseable fraction number: \"{0}\"", source);
    }
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:FractionFormat.java

示例3: parse

import org.apache.commons.math.MathRuntimeException; //导入方法依赖的package包/类
/**
 * Parses a string to produce a {@link RealVector} object.
 * @param source the string to parse
 * @return the parsed {@link RealVector} object.
 * @exception ParseException if the beginning of the specified string
 *            cannot be parsed.
 */
public ArrayRealVector parse(String source) throws ParseException {
    ParsePosition parsePosition = new ParsePosition(0);
    ArrayRealVector result = parse(source, parsePosition);
    if (parsePosition.getIndex() == 0) {
        throw MathRuntimeException.createParseException(
                parsePosition.getErrorIndex(),
                "unparseable real vector: \"{0}\"", source);
    }
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:18,代码来源:RealVectorFormat.java

示例4: parse

import org.apache.commons.math.MathRuntimeException; //导入方法依赖的package包/类
/**
 * Parses a string to produce a {@link Fraction} object.
 * @param source the string to parse
 * @return the parsed {@link Fraction} object.
 * @exception ParseException if the beginning of the specified string
 *            cannot be parsed.
 */
@Override
public Fraction parse(final String source) throws ParseException {
    final ParsePosition parsePosition = new ParsePosition(0);
    final Fraction result = parse(source, parsePosition);
    if (parsePosition.getIndex() == 0) {
        throw MathRuntimeException.createParseException(
                parsePosition.getErrorIndex(),
                LocalizedFormats.UNPARSEABLE_FRACTION_NUMBER, source);
    }
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:FractionFormat.java

示例5: parse

import org.apache.commons.math.MathRuntimeException; //导入方法依赖的package包/类
/**
 * Parses a string to produce a {@link BigFraction} object.
 * @param source the string to parse
 * @return the parsed {@link BigFraction} object.
 * @exception ParseException if the beginning of the specified string
 *            cannot be parsed.
 */
@Override
public BigFraction parse(final String source) throws ParseException {
    final ParsePosition parsePosition = new ParsePosition(0);
    final BigFraction result = parse(source, parsePosition);
    if (parsePosition.getIndex() == 0) {
        throw MathRuntimeException.createParseException(
                parsePosition.getErrorIndex(),
                LocalizedFormats.UNPARSEABLE_FRACTION_NUMBER, source);
    }
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:BigFractionFormat.java

示例6: parse

import org.apache.commons.math.MathRuntimeException; //导入方法依赖的package包/类
/**
 * Parses a string to produce a {@link Complex} object.
 *
 * @param source the string to parse
 * @return the parsed {@link Complex} object.
 * @exception ParseException if the beginning of the specified string
 *            cannot be parsed.
 */
public Complex parse(String source) throws ParseException {
    ParsePosition parsePosition = new ParsePosition(0);
    Complex result = parse(source, parsePosition);
    if (parsePosition.getIndex() == 0) {
        throw MathRuntimeException.createParseException(
                parsePosition.getErrorIndex(),
                "unparseable complex number: \"{0}\"", source);
    }
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:ComplexFormat.java

示例7: parse

import org.apache.commons.math.MathRuntimeException; //导入方法依赖的package包/类
/**
 * Parses a string to produce a {@link BigFraction} object.
 * @param source the string to parse
 * @return the parsed {@link BigFraction} object.
 * @exception ParseException if the beginning of the specified string
 *            cannot be parsed.
 */
@Override
public BigFraction parse(final String source) throws ParseException {
    final ParsePosition parsePosition = new ParsePosition(0);
    final BigFraction result = parse(source, parsePosition);
    if (parsePosition.getIndex() == 0) {
        throw MathRuntimeException.createParseException(
                parsePosition.getErrorIndex(),
                "unparseable fraction number: \"{0}\"", source);
    }
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:BigFractionFormat.java


注:本文中的org.apache.commons.math.MathRuntimeException.createParseException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。