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

io.virtdata.basicsmappers.from_long.to_long.Scale Maven / Gradle / Ivy

There is a newer version: 2.12.15
Show newest version
package io.virtdata.basicsmappers.from_long.to_long;

import io.virtdata.annotations.ThreadSafeMapper;

import java.util.function.LongUnaryOperator;

/**
 * Scale the input to the
 */
@ThreadSafeMapper
public class Scale implements LongUnaryOperator {

    private final double scaleFactor;

    public Scale(double scaleFactor) {
        this.scaleFactor = scaleFactor;
    }

    @Override
    public long applyAsLong(long value) {
        return (long) (scaleFactor * (double) value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy