Add missing @Override tags.

This commit is contained in:
Thomas Neidhart 2015-03-10 22:42:03 +01:00
parent 45df5da264
commit ab9c3e935e
21 changed files with 128 additions and 8 deletions

View File

@ -153,6 +153,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
* @return {@code this + addend}.
* @throws NullArgumentException if {@code addend} is {@code null}.
*/
@Override
public Complex add(Complex addend) throws NullArgumentException {
MathUtils.checkNotNull(addend);
if (isNaN || addend.isNaN) {
@ -243,6 +244,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
* @return {@code this / divisor}.
* @throws NullArgumentException if {@code divisor} is {@code null}.
*/
@Override
public Complex divide(Complex divisor)
throws NullArgumentException {
MathUtils.checkNotNull(divisor);
@ -296,6 +298,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
}
/** {@inheritDoc} */
@Override
public Complex reciprocal() {
if (isNaN) {
return NaN;
@ -520,6 +523,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
* @return {@code this * factor}.
* @throws NullArgumentException if {@code factor} is {@code null}.
*/
@Override
public Complex multiply(Complex factor)
throws NullArgumentException {
MathUtils.checkNotNull(factor);
@ -545,6 +549,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
* @return {@code this * factor}.
* @see #multiply(Complex)
*/
@Override
public Complex multiply(final int factor) {
if (isNaN) {
return NaN;
@ -584,6 +589,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
*
* @return {@code -this}.
*/
@Override
public Complex negate() {
if (isNaN) {
return NaN;
@ -610,6 +616,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
* @return {@code this - subtrahend}.
* @throws NullArgumentException if {@code subtrahend} is {@code null}.
*/
@Override
public Complex subtract(Complex subtrahend)
throws NullArgumentException {
MathUtils.checkNotNull(subtrahend);
@ -1305,6 +1312,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
}
/** {@inheritDoc} */
@Override
public ComplexField getField() {
return ComplexField.getInstance();
}

View File

@ -30,7 +30,7 @@ import org.apache.commons.math4.FieldElement;
* @see Complex
* @since 2.0
*/
public class ComplexField implements Field<Complex>, Serializable {
public class ComplexField implements Field<Complex>, Serializable {
/** Serializable version identifier. */
private static final long serialVersionUID = -6130362688700788798L;
@ -48,16 +48,19 @@ public class ComplexField implements Field<Complex>, Serializable {
}
/** {@inheritDoc} */
@Override
public Complex getOne() {
return Complex.ONE;
}
/** {@inheritDoc} */
@Override
public Complex getZero() {
return Complex.ZERO;
}
/** {@inheritDoc} */
@Override
public Class<? extends FieldElement<Complex>> getRuntimeClass() {
return Complex.class;
}

View File

@ -398,6 +398,7 @@ public class DfpField implements Field<Dfp> {
/** Get the constant 0.
* @return a {@link Dfp} with value 0
*/
@Override
public Dfp getZero() {
return zero;
}
@ -405,11 +406,13 @@ public class DfpField implements Field<Dfp> {
/** Get the constant 1.
* @return a {@link Dfp} with value 1
*/
@Override
public Dfp getOne() {
return one;
}
/** {@inheritDoc} */
@Override
public Class<? extends FieldElement<Dfp>> getRuntimeClass() {
return Dfp.class;
}

View File

@ -21,7 +21,6 @@ import org.apache.commons.math4.analysis.UnivariateFunction;
import org.apache.commons.math4.exception.ConvergenceException;
import org.apache.commons.math4.exception.MathIllegalArgumentException;
import org.apache.commons.math4.exception.util.LocalizedFormats;
import org.apache.commons.math4.special.Gamma;
import org.apache.commons.math4.util.FastMath;
import org.apache.commons.math4.util.MathArrays;
@ -139,6 +138,7 @@ public class BesselJ
* @throws MathIllegalArgumentException if {@code x} is too large relative to {@code order}
* @throws ConvergenceException if the algorithm fails to converge
*/
@Override
public double value(double x)
throws MathIllegalArgumentException, ConvergenceException {
return BesselJ.value(order, x);

View File

@ -87,6 +87,7 @@ public class FastCosineTransformer implements RealTransformer, Serializable {
* @throws MathIllegalArgumentException if the length of the data array is
* not a power of two plus one
*/
@Override
public double[] transform(final double[] f, final TransformType type)
throws MathIllegalArgumentException {
if (type == TransformType.FORWARD) {
@ -116,6 +117,7 @@ public class FastCosineTransformer implements RealTransformer, Serializable {
* @throws MathIllegalArgumentException if the number of sample points is
* not a power of two plus one
*/
@Override
public double[] transform(final UnivariateFunction f,
final double min, final double max, final int n,
final TransformType type) throws MathIllegalArgumentException {

View File

@ -47,6 +47,7 @@ public class FastHadamardTransformer implements RealTransformer, Serializable {
* @throws MathIllegalArgumentException if the length of the data array is
* not a power of two
*/
@Override
public double[] transform(final double[] f, final TransformType type) {
if (type == TransformType.FORWARD) {
return fht(f);
@ -63,6 +64,7 @@ public class FastHadamardTransformer implements RealTransformer, Serializable {
* if the number of sample points is negative
* @throws MathIllegalArgumentException if the number of sample points is not a power of two
*/
@Override
public double[] transform(final UnivariateFunction f,
final double min, final double max, final int n,
final TransformType type) {

View File

@ -92,6 +92,7 @@ public class FastSineTransformer implements RealTransformer, Serializable {
* @throws MathIllegalArgumentException if the length of the data array is
* not a power of two, or the first element of the data array is not zero
*/
@Override
public double[] transform(final double[] f, final TransformType type) {
if (normalization == DstNormalization.ORTHOGONAL_DST_I) {
final double s = FastMath.sqrt(2.0 / f.length);
@ -115,6 +116,7 @@ public class FastSineTransformer implements RealTransformer, Serializable {
* if the number of sample points is negative
* @throws MathIllegalArgumentException if the number of sample points is not a power of two
*/
@Override
public double[] transform(final UnivariateFunction f,
final double min, final double max, final int n,
final TransformType type) {

View File

@ -228,16 +228,19 @@ public class BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Seri
}
/** {@inheritDoc} */
@Override
public BigReal add(BigReal a) {
return new BigReal(d.add(a.d));
}
/** {@inheritDoc} */
@Override
public BigReal subtract(BigReal a) {
return new BigReal(d.subtract(a.d));
}
/** {@inheritDoc} */
@Override
public BigReal negate() {
return new BigReal(d.negate());
}
@ -247,6 +250,7 @@ public class BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Seri
*
* @throws MathArithmeticException if {@code a} is zero
*/
@Override
public BigReal divide(BigReal a) throws MathArithmeticException {
try {
return new BigReal(d.divide(a.d, scale, roundingMode));
@ -261,6 +265,7 @@ public class BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Seri
*
* @throws MathArithmeticException if {@code this} is zero
*/
@Override
public BigReal reciprocal() throws MathArithmeticException {
try {
return new BigReal(BigDecimal.ONE.divide(d, scale, roundingMode));
@ -271,16 +276,19 @@ public class BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Seri
}
/** {@inheritDoc} */
@Override
public BigReal multiply(BigReal a) {
return new BigReal(d.multiply(a.d));
}
/** {@inheritDoc} */
@Override
public BigReal multiply(final int n) {
return new BigReal(d.multiply(new BigDecimal(n)));
}
/** {@inheritDoc} */
@Override
public int compareTo(BigReal a) {
return d.compareTo(a.d);
}
@ -319,6 +327,7 @@ public class BigReal implements FieldElement<BigReal>, Comparable<BigReal>, Seri
}
/** {@inheritDoc} */
@Override
public Field<BigReal> getField() {
return BigRealField.getInstance();
}

View File

@ -48,16 +48,19 @@ public class BigRealField implements Field<BigReal>, Serializable {
}
/** {@inheritDoc} */
@Override
public BigReal getOne() {
return BigReal.ONE;
}
/** {@inheritDoc} */
@Override
public BigReal getZero() {
return BigReal.ZERO;
}
/** {@inheritDoc} */
@Override
public Class<? extends FieldElement<BigReal>> getRuntimeClass() {
return BigReal.class;
}

View File

@ -37,6 +37,7 @@ public class CentralPivotingStrategy implements PivotingStrategyInterface, Seria
* the first and the last element indices of the array slice
* @throws MathIllegalArgumentException when indices exceeds range
*/
@Override
public int pivotIndex(final double[] work, final int begin, final int end)
throws MathIllegalArgumentException {
MathArrays.verifyValues(work, begin, end-begin);

View File

@ -16,11 +16,11 @@
*/
package org.apache.commons.math4.util;
import java.util.Iterator;
import java.util.Comparator;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.exception.MathInternalError;
@ -129,6 +129,7 @@ public class Combinations implements Iterable<int[]> {
}
/** {@inheritDoc} */
@Override
public Iterator<int[]> iterator() {
if (k == 0 ||
k == n) {
@ -224,6 +225,7 @@ public class Combinations implements Iterable<int[]> {
/**
* {@inheritDoc}
*/
@Override
public boolean hasNext() {
return more;
}
@ -231,6 +233,7 @@ public class Combinations implements Iterable<int[]> {
/**
* {@inheritDoc}
*/
@Override
public int[] next() {
if (!more) {
throw new NoSuchElementException();
@ -280,6 +283,7 @@ public class Combinations implements Iterable<int[]> {
/**
* Not supported.
*/
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@ -302,10 +306,12 @@ public class Combinations implements Iterable<int[]> {
this.singleton = singleton;
}
/** @return True until next is called the first time, then false */
@Override
public boolean hasNext() {
return more;
}
/** @return the singleton in first activation; throws NSEE thereafter */
@Override
public int[] next() {
if (more) {
more = false;
@ -315,6 +321,7 @@ public class Combinations implements Iterable<int[]> {
}
}
/** Not supported */
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@ -351,6 +358,7 @@ public class Combinations implements Iterable<int[]> {
* @throws OutOfRangeException if an element of the array is not
* within the interval [0, {@code n}).
*/
@Override
public int compare(int[] c1,
int[] c2) {
if (c1.length != k) {

View File

@ -79,6 +79,7 @@ public class Decimal64 extends Number
*/
/** {@inheritDoc} */
@Override
public Field<Decimal64> getField() {
return Decimal64Field.getInstance();
}
@ -90,6 +91,7 @@ public class Decimal64 extends Number
* {@code this.add(a).equals(new Decimal64(this.doubleValue()
* + a.doubleValue()))}.
*/
@Override
public Decimal64 add(final Decimal64 a) {
return new Decimal64(this.value + a.value);
}
@ -101,6 +103,7 @@ public class Decimal64 extends Number
* {@code this.subtract(a).equals(new Decimal64(this.doubleValue()
* - a.doubleValue()))}.
*/
@Override
public Decimal64 subtract(final Decimal64 a) {
return new Decimal64(this.value - a.value);
}
@ -111,6 +114,7 @@ public class Decimal64 extends Number
* The current implementation strictly enforces
* {@code this.negate().equals(new Decimal64(-this.doubleValue()))}.
*/
@Override
public Decimal64 negate() {
return new Decimal64(-this.value);
}
@ -122,6 +126,7 @@ public class Decimal64 extends Number
* {@code this.multiply(a).equals(new Decimal64(this.doubleValue()
* * a.doubleValue()))}.
*/
@Override
public Decimal64 multiply(final Decimal64 a) {
return new Decimal64(this.value * a.value);
}
@ -132,6 +137,7 @@ public class Decimal64 extends Number
* The current implementation strictly enforces
* {@code this.multiply(n).equals(new Decimal64(n * this.doubleValue()))}.
*/
@Override
public Decimal64 multiply(final int n) {
return new Decimal64(n * this.value);
}
@ -144,6 +150,7 @@ public class Decimal64 extends Number
* / a.doubleValue()))}.
*
*/
@Override
public Decimal64 divide(final Decimal64 a) {
return new Decimal64(this.value / a.value);
}
@ -155,6 +162,7 @@ public class Decimal64 extends Number
* {@code this.reciprocal().equals(new Decimal64(1.0
* / this.doubleValue()))}.
*/
@Override
public Decimal64 reciprocal() {
return new Decimal64(1.0 / this.value);
}
@ -232,6 +240,7 @@ public class Decimal64 extends Number
*
* @see Double#compareTo(Double)
*/
@Override
public int compareTo(final Decimal64 o) {
return Double.compare(this.value, o.value);
}
@ -305,6 +314,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public double getReal() {
return value;
}
@ -312,6 +322,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 add(final double a) {
return new Decimal64(value + a);
}
@ -319,6 +330,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 subtract(final double a) {
return new Decimal64(value - a);
}
@ -326,6 +338,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 multiply(final double a) {
return new Decimal64(value * a);
}
@ -333,6 +346,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 divide(final double a) {
return new Decimal64(value / a);
}
@ -340,6 +354,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 remainder(final double a) {
return new Decimal64(FastMath.IEEEremainder(value, a));
}
@ -347,6 +362,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 remainder(final Decimal64 a) {
return new Decimal64(FastMath.IEEEremainder(value, a.value));
}
@ -354,6 +370,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 abs() {
return new Decimal64(FastMath.abs(value));
}
@ -361,6 +378,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 ceil() {
return new Decimal64(FastMath.ceil(value));
}
@ -368,6 +386,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 floor() {
return new Decimal64(FastMath.floor(value));
}
@ -375,6 +394,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 rint() {
return new Decimal64(FastMath.rint(value));
}
@ -382,6 +402,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public long round() {
return FastMath.round(value);
}
@ -389,6 +410,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 signum() {
return new Decimal64(FastMath.signum(value));
}
@ -396,6 +418,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 copySign(final Decimal64 sign) {
return new Decimal64(FastMath.copySign(value, sign.value));
}
@ -403,6 +426,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 copySign(final double sign) {
return new Decimal64(FastMath.copySign(value, sign));
}
@ -410,6 +434,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 scalb(final int n) {
return new Decimal64(FastMath.scalb(value, n));
}
@ -417,6 +442,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 hypot(final Decimal64 y) {
return new Decimal64(FastMath.hypot(value, y.value));
}
@ -424,6 +450,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 sqrt() {
return new Decimal64(FastMath.sqrt(value));
}
@ -431,6 +458,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 cbrt() {
return new Decimal64(FastMath.cbrt(value));
}
@ -438,6 +466,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 rootN(final int n) {
if (value < 0) {
return new Decimal64(-FastMath.pow(-value, 1.0 / n));
@ -449,6 +478,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 pow(final double p) {
return new Decimal64(FastMath.pow(value, p));
}
@ -456,6 +486,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 pow(final int n) {
return new Decimal64(FastMath.pow(value, n));
}
@ -463,6 +494,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 pow(final Decimal64 e) {
return new Decimal64(FastMath.pow(value, e.value));
}
@ -470,6 +502,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 exp() {
return new Decimal64(FastMath.exp(value));
}
@ -477,6 +510,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 expm1() {
return new Decimal64(FastMath.expm1(value));
}
@ -484,6 +518,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 log() {
return new Decimal64(FastMath.log(value));
}
@ -491,6 +526,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 log1p() {
return new Decimal64(FastMath.log1p(value));
}
@ -499,6 +535,7 @@ public class Decimal64 extends Number
* @return base 10 logarithm of the instance
* @since 3.2
*/
@Override
public Decimal64 log10() {
return new Decimal64(FastMath.log10(value));
}
@ -506,6 +543,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 cos() {
return new Decimal64(FastMath.cos(value));
}
@ -513,6 +551,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 sin() {
return new Decimal64(FastMath.sin(value));
}
@ -520,6 +559,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 tan() {
return new Decimal64(FastMath.tan(value));
}
@ -527,6 +567,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 acos() {
return new Decimal64(FastMath.acos(value));
}
@ -534,6 +575,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 asin() {
return new Decimal64(FastMath.asin(value));
}
@ -541,6 +583,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 atan() {
return new Decimal64(FastMath.atan(value));
}
@ -548,6 +591,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 atan2(final Decimal64 x) {
return new Decimal64(FastMath.atan2(value, x.value));
}
@ -555,6 +599,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 cosh() {
return new Decimal64(FastMath.cosh(value));
}
@ -562,6 +607,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 sinh() {
return new Decimal64(FastMath.sinh(value));
}
@ -569,6 +615,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 tanh() {
return new Decimal64(FastMath.tanh(value));
}
@ -576,6 +623,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 acosh() {
return new Decimal64(FastMath.acosh(value));
}
@ -583,6 +631,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 asinh() {
return new Decimal64(FastMath.asinh(value));
}
@ -590,6 +639,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 atanh() {
return new Decimal64(FastMath.atanh(value));
}
@ -597,6 +647,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final Decimal64[] a, final Decimal64[] b)
throws DimensionMismatchException {
if (a.length != b.length) {
@ -614,6 +665,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final double[] a, final Decimal64[] b)
throws DimensionMismatchException {
if (a.length != b.length) {
@ -629,6 +681,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final Decimal64 a1, final Decimal64 b1,
final Decimal64 a2, final Decimal64 b2) {
return new Decimal64(MathArrays.linearCombination(a1.value, b1.value,
@ -638,6 +691,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final double a1, final Decimal64 b1,
final double a2, final Decimal64 b2) {
return new Decimal64(MathArrays.linearCombination(a1, b1.value,
@ -647,6 +701,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final Decimal64 a1, final Decimal64 b1,
final Decimal64 a2, final Decimal64 b2,
final Decimal64 a3, final Decimal64 b3) {
@ -658,6 +713,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final double a1, final Decimal64 b1,
final double a2, final Decimal64 b2,
final double a3, final Decimal64 b3) {
@ -669,6 +725,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final Decimal64 a1, final Decimal64 b1,
final Decimal64 a2, final Decimal64 b2,
final Decimal64 a3, final Decimal64 b3,
@ -682,6 +739,7 @@ public class Decimal64 extends Number
/** {@inheritDoc}
* @since 3.2
*/
@Override
public Decimal64 linearCombination(final double a1, final Decimal64 b1,
final double a2, final Decimal64 b2,
final double a3, final Decimal64 b3,

View File

@ -45,16 +45,19 @@ public class Decimal64Field implements Field<Decimal64> {
}
/** {@inheritDoc} */
@Override
public Decimal64 getZero() {
return Decimal64.ZERO;
}
/** {@inheritDoc} */
@Override
public Decimal64 getOne() {
return Decimal64.ONE;
}
/** {@inheritDoc} */
@Override
public Class<? extends FieldElement<Decimal64>> getRuntimeClass() {
return Decimal64.class;
}

View File

@ -28,7 +28,6 @@ import org.apache.commons.math4.exception.util.LocalizedFormats;
* provides some simple conversion capabilities to turn any java.lang.Number
* into a primitive double or to turn a String representation of a Number into
* a double.
*
*/
public class DefaultTransformer implements NumberTransformer, Serializable {
@ -43,6 +42,7 @@ public class DefaultTransformer implements NumberTransformer, Serializable {
* cannot successfully be transformed
* @see <a href="http://commons.apache.org/collections/api-release/org/apache/commons/collections/Transformer.html">Commons Collections Transformer</a>
*/
@Override
public double transform(Object o)
throws NullArgumentException, MathIllegalArgumentException {

View File

@ -61,7 +61,8 @@ public class Incrementor {
this(max,
new MaxCountExceededCallback() {
/** {@inheritDoc} */
public void trigger(int max) throws MaxCountExceededException {
@Override
public void trigger(int max) throws MaxCountExceededException {
throw new MaxCountExceededException(max);
}
});

View File

@ -727,11 +727,13 @@ public class MathArrays {
final Comparator<Pair<Double, Integer>> comp
= dir == MathArrays.OrderDirection.INCREASING ?
new Comparator<Pair<Double, Integer>>() {
@Override
public int compare(Pair<Double, Integer> o1,
Pair<Double, Integer> o2) {
return o1.getKey().compareTo(o2.getKey());
}
} : new Comparator<Pair<Double,Integer>>() {
@Override
public int compare(Pair<Double, Integer> o1,
Pair<Double, Integer> o2) {
return o2.getKey().compareTo(o1.getKey());

View File

@ -36,6 +36,7 @@ public class MedianOf3PivotingStrategy implements PivotingStrategyInterface, Ser
* first, middle and the last indices of the array slice
* @throws MathIllegalArgumentException when indices exceeds range
*/
@Override
public int pivotIndex(final double[] work, final int begin, final int end)
throws MathIllegalArgumentException {
MathArrays.verifyValues(work, begin, end-begin);

View File

@ -94,6 +94,7 @@ public class MultidimensionalCounter implements Iterable<Integer> {
/**
* {@inheritDoc}
*/
@Override
public boolean hasNext() {
return count < maxCount;
}
@ -104,6 +105,7 @@ public class MultidimensionalCounter implements Iterable<Integer> {
* @throws NoSuchElementException if {@link #hasNext()} would have
* returned {@code false}.
*/
@Override
public Integer next() {
if (!hasNext()) {
throw new NoSuchElementException();
@ -156,6 +158,7 @@ public class MultidimensionalCounter implements Iterable<Integer> {
/**
* @throws UnsupportedOperationException
*/
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@ -198,6 +201,7 @@ public class MultidimensionalCounter implements Iterable<Integer> {
*
* @return the iterator.
*/
@Override
public Iterator iterator() {
return new Iterator();
}

View File

@ -48,6 +48,7 @@ public class RandomPivotingStrategy implements PivotingStrategyInterface, Serial
* value between first and the last indices of the array slice
* @throws MathIllegalArgumentException when indices exceeds range
*/
@Override
public int pivotIndex(final double[] work, final int begin, final int end)
throws MathIllegalArgumentException {
MathArrays.verifyValues(work, begin, end-begin);

View File

@ -437,6 +437,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
*
* @param value Value to be added to end of array.
*/
@Override
public synchronized void addElement(double value) {
if (internalArray.length <= startIndex + numElements) {
expand();
@ -450,6 +451,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* @param values Values to be added to end of array.
* @since 2.2
*/
@Override
public synchronized void addElements(double[] values) {
final double[] tempArray = new double[numElements + values.length + 1];
System.arraycopy(internalArray, startIndex, tempArray, 0, numElements);
@ -475,6 +477,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* @return the value which has been discarded or "pushed" out of the array
* by this rolling insert.
*/
@Override
public synchronized double addElementRolling(double value) {
double discarded = internalArray[startIndex];
@ -578,6 +581,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
/**
* Clear the array contents, resetting the number of elements to zero.
*/
@Override
public synchronized void clear() {
numElements = 0;
startIndex = 0;
@ -757,6 +761,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* @throws ArrayIndexOutOfBoundsException if <code>index</code> is less than
* zero or is greater than <code>getNumElements() - 1</code>.
*/
@Override
public synchronized double getElement(int index) {
if (index >= numElements) {
throw new ArrayIndexOutOfBoundsException(index);
@ -774,6 +779,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* array have no effect on this <code>ResizableArray.</code>
* @return the double array.
*/
@Override
public synchronized double[] getElements() {
final double[] elementArray = new double[numElements];
System.arraycopy(internalArray, startIndex, elementArray, 0, numElements);
@ -851,6 +857,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
*
* @return the number of elements.
*/
@Override
public synchronized int getNumElements() {
return numElements;
}
@ -958,6 +965,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* @param value value to store at the specified index
* @throws ArrayIndexOutOfBoundsException if {@code index < 0}.
*/
@Override
public synchronized void setElement(int index, double value) {
if (index < 0) {
throw new ArrayIndexOutOfBoundsException(index);

View File

@ -137,6 +137,7 @@ public class TransformerMap implements NumberTransformer, Serializable {
* transformed into a Double.
* @see org.apache.commons.math4.util.NumberTransformer#transform(java.lang.Object)
*/
@Override
public double transform(Object o) throws MathIllegalArgumentException {
double value = Double.NaN;