All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tfw.immutable.ila.floatila.FloatIlaNegate Maven / Gradle / Ivy

package tfw.immutable.ila.floatila;

import tfw.check.Argument;
import tfw.immutable.DataInvalidException;

public final class FloatIlaNegate {
    private FloatIlaNegate() {
        // non-instantiable class
    }

    public static FloatIla create(FloatIla ila) {
        Argument.assertNotNull(ila, "ila");

        return new MyFloatIla(ila);
    }

    private static class MyFloatIla extends AbstractFloatIla {
        private final FloatIla ila;

        MyFloatIla(FloatIla ila) {
            super(ila.length());

            this.ila = ila;
        }

        protected void toArrayImpl(float[] array, int offset, long start, int length) throws DataInvalidException {
            ila.toArray(array, offset, start, length);

            for (int ii = offset; length > 0; ii++, --length) {
                array[ii] = -array[ii];
            }
        }
    }
}
// AUTO GENERATED FROM TEMPLATE




© 2015 - 2024 Weber Informatics LLC | Privacy Policy