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

com.wselwood.mpcreader.modifiers.RadianModifier Maven / Gradle / Ivy

There is a newer version: 0.1.1
Show newest version
package com.wselwood.mpcreader.modifiers;

import com.wselwood.mpcreader.InvalidDataException;
import com.wselwood.mpcreader.columns.Container;

import java.util.Map;

/**
 * Convert a column into radians from degrees.
 *
 * Created by wselwood on 03/05/14.
 */
public class RadianModifier implements Modifier {

    public RadianModifier(Container target) {
        this.target = target;
    }

    @Override
    public void process() throws InvalidDataException {
        Double value = target.get();
        if(value != null) {
            target.set(value * conversionFactor);
        }
    }

    private static final Double conversionFactor = Math.PI / 180.0;

    private Container target;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy