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

com.wselwood.mpcreader.modifiers.ArcLengthModifier 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;

/**
 * Created by wselwood on 03/05/14.
 */
public class ArcLengthModifier implements Modifier {

    public ArcLengthModifier(Container num, Container input, Container arcLength) {
        this.num = num;
        this.input = input;
        this.arcLength = arcLength;
    }

    @Override
    public void process() throws InvalidDataException {
        if(num.get() <= 1) {
            arcLength.set(Integer.parseInt(input.get().split(" ", 2)[0].trim()));
        }
        else {
            arcLength.set(-1);
        }
    }

    private final Container num;
    private final Container input;
    private final Container arcLength;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy