/** * @param wrong Bad string representation of the object. * @param position Index, in the {@code wrong} string, that caused the * parsing to fail. */ public MathParseException(String wrong, int position) { getContext().addMessage(LocalizedFormats.CANNOT_PARSE, wrong, Integer.valueOf(position)); } }
/** {@inheritDoc} */ @Override public Vector2D parse(final String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Vector2D result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Vector2D.class); } return result; }
/** {@inheritDoc} */ @Override public Vector1D parse(final String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Vector1D result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Vector1D.class); } return result; }
/** * @param wrong Bad string representation of the object. * @param position Index, in the {@code wrong} string, that caused the * parsing to fail. * @param type Class of the object supposedly represented by the * {@code wrong} string. */ public MathParseException(String wrong, int position, Class<?> type) { getContext().addMessage(LocalizedFormats.CANNOT_PARSE_AS_TYPE, wrong, Integer.valueOf(position), type.getName()); }
/** * Parses a string to produce a {@link BigFraction} object. * @param source the string to parse * @return the parsed {@link BigFraction} object. * @exception MathParseException if the beginning of the specified string * cannot be parsed. */ @Override public BigFraction parse(final String source) throws MathParseException { final ParsePosition parsePosition = new ParsePosition(0); final BigFraction result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), BigFraction.class); } return result; }
/** * @param wrong Bad string representation of the object. * @param position Index, in the {@code wrong} string, that caused the * parsing to fail. */ public MathParseException(String wrong, int position) { getContext().addMessage(LocalizedFormats.CANNOT_PARSE, wrong, Integer.valueOf(position)); } }
/** * Parses a string to produce a {@link Fraction} object. * @param source the string to parse * @return the parsed {@link Fraction} object. * @exception MathParseException if the beginning of the specified string * cannot be parsed. */ @Override public Fraction parse(final String source) throws MathParseException { final ParsePosition parsePosition = new ParsePosition(0); final Fraction result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Fraction.class); } return result; }
/** * @param wrong Bad string representation of the object. * @param position Index, in the {@code wrong} string, that caused the * parsing to fail. */ public MathParseException(String wrong, int position) { getContext().addMessage(LocalizedFormats.CANNOT_PARSE, wrong, Integer.valueOf(position)); } }
/** * Parse a string to produce a {@link RealMatrix} object. * * @param source String to parse. * @return the parsed {@link RealMatrix} object. * @throws MathParseException if the beginning of the specified string * cannot be parsed. */ public RealMatrix parse(String source) { final ParsePosition parsePosition = new ParsePosition(0); final RealMatrix result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Array2DRowRealMatrix.class); } return result; }
/** * @param wrong Bad string representation of the object. * @param position Index, in the {@code wrong} string, that caused the * parsing to fail. * @param type Class of the object supposedly represented by the * {@code wrong} string. */ public MathParseException(String wrong, int position, Class<?> type) { getContext().addMessage(LocalizedFormats.CANNOT_PARSE_AS_TYPE, wrong, Integer.valueOf(position), type.getName()); }
/** * Parses a string to produce a {@link Complex} object. * * @param source the string to parse. * @return the parsed {@link Complex} object. * @throws MathParseException if the beginning of the specified string * cannot be parsed. */ public Complex parse(String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Complex result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Complex.class); } return result; }
/** * @param wrong Bad string representation of the object. * @param position Index, in the {@code wrong} string, that caused the * parsing to fail. * @param type Class of the object supposedly represented by the * {@code wrong} string. */ public MathParseException(String wrong, int position, Class<?> type) { getContext().addMessage(LocalizedFormats.CANNOT_PARSE_AS_TYPE, wrong, Integer.valueOf(position), type.getName()); }
/** * Parses a string to produce a {@link Vector3D} object. * @param source the string to parse * @return the parsed {@link Vector3D} object. * @throws MathParseException if the beginning of the specified string * cannot be parsed. */ @Override public Vector3D parse(final String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Vector3D result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Vector3D.class); } return result; }
/** * Parse a string to produce a {@link RealVector} object. * * @param source String to parse. * @return the parsed {@link RealVector} object. * @throws MathParseException if the beginning of the specified string * cannot be parsed. */ public ArrayRealVector parse(String source) { final ParsePosition parsePosition = new ParsePosition(0); final ArrayRealVector result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), ArrayRealVector.class); } return result; }
throw new MathParseException(line, lineNumber); } catch (NumberFormatException e) { throw new MathParseException(line, lineNumber);
/** {@inheritDoc} */ @Override public Vector2D parse(final String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Vector2D result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Vector2D.class); } return result; }
/** {@inheritDoc} */ @Override public Vector1D parse(final String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Vector1D result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Vector1D.class); } return result; }
/** * Parses a string to produce a {@link BigFraction} object. * @param source the string to parse * @return the parsed {@link BigFraction} object. * @exception MathParseException if the beginning of the specified string * cannot be parsed. */ @Override public BigFraction parse(final String source) throws MathParseException { final ParsePosition parsePosition = new ParsePosition(0); final BigFraction result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), BigFraction.class); } return result; }
/** * Parses a string to produce a {@link Fraction} object. * @param source the string to parse * @return the parsed {@link Fraction} object. * @exception MathParseException if the beginning of the specified string * cannot be parsed. */ @Override public Fraction parse(final String source) throws MathParseException { final ParsePosition parsePosition = new ParsePosition(0); final Fraction result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Fraction.class); } return result; }
/** * Parses a string to produce a {@link Complex} object. * * @param source the string to parse. * @return the parsed {@link Complex} object. * @throws MathParseException if the beginning of the specified string * cannot be parsed. */ public Complex parse(String source) throws MathParseException { ParsePosition parsePosition = new ParsePosition(0); Complex result = parse(source, parsePosition); if (parsePosition.getIndex() == 0) { throw new MathParseException(source, parsePosition.getErrorIndex(), Complex.class); } return result; }